{"id":22555842,"url":"https://github.com/0plus1/experimentaldatecomp","last_synced_at":"2025-03-28T11:13:15.268Z","repository":{"id":145293816,"uuid":"87934961","full_name":"0plus1/experimentaldatecomp","owner":"0plus1","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-11T14:18:58.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T11:29:22.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0plus1.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T13:05:02.000Z","updated_at":"2017-04-11T13:27:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"65695081-86b8-4bac-87a5-8550df21476c","html_url":"https://github.com/0plus1/experimentaldatecomp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0plus1%2Fexperimentaldatecomp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0plus1%2Fexperimentaldatecomp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0plus1%2Fexperimentaldatecomp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0plus1%2Fexperimentaldatecomp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0plus1","download_url":"https://codeload.github.com/0plus1/experimentaldatecomp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246017731,"owners_count":20710240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T19:09:09.935Z","updated_at":"2025-03-28T11:13:15.262Z","avatar_url":"https://github.com/0plus1.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Description\nAn experimental library for date comparison.\n\nThis experiment doesn't use any of the PHP/C/HHVM libraries to solve the challenge.\nCalculating the days between two dates is not a trivial issue, to avoid inelegant solutions, I opted for using the Julian day number as an epoch, then running a simple subtraction.\nAfter a long research, the most reliable formula is the one on [wikipedia](https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_day_number) which had to be adapted to work around PHP notorious issues with floats.\n\nThis library does some basic validations and takes into consideration leap year.\n\nYear range: 0 to INT_MAX\n\n### INSTALL\n```composer install```\n\nPlease note that the required libraries are just for testing and easier CLI output/input.\n\n### USAGE\n```php do.php app:dateDiff \"DD MM YYYY\" \"DD MM YYYY\"```\n\nOr use the included bash script which runs several dates in a row: ```bash doLots.bash```\n\nCommand will output ```EARLIEST_DATE, LATEST_DATE, DAY_DIFF```\n\n### TESTS\n```./vendor/bin/phpunit```\n\nPlease note that system wide installs of phpunit might not work, relying on the composer installed bin is the safest bet.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0plus1%2Fexperimentaldatecomp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0plus1%2Fexperimentaldatecomp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0plus1%2Fexperimentaldatecomp/lists"}