{"id":23893356,"url":"https://github.com/sumpygump/distance-between-dates","last_synced_at":"2026-06-03T16:31:04.826Z","repository":{"id":142195911,"uuid":"41703914","full_name":"sumpygump/distance-between-dates","owner":"sumpygump","description":"Solution to PHP challenge 018","archived":false,"fork":false,"pushed_at":"2015-09-01T22:15:45.000Z","size":512,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T06:12:30.895Z","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/sumpygump.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}},"created_at":"2015-08-31T22:31:38.000Z","updated_at":"2015-08-31T22:33:04.000Z","dependencies_parsed_at":"2023-03-13T10:14:18.667Z","dependency_job_id":null,"html_url":"https://github.com/sumpygump/distance-between-dates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sumpygump/distance-between-dates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fdistance-between-dates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fdistance-between-dates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fdistance-between-dates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fdistance-between-dates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumpygump","download_url":"https://codeload.github.com/sumpygump/distance-between-dates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fdistance-between-dates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33874679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-01-04T14:17:53.573Z","updated_at":"2026-06-03T16:31:04.809Z","avatar_url":"https://github.com/sumpygump.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distance Between Dates\n\nSolution to PHP challenge 018\n\n## Challenge Description\n\nWrite a function or class that calculates the difference between two dates in months.\n\n - Assume the input will be two parameters in the format YYYYMM BUT not strings, integers (e.g. 201508).\n - Assume there are no incorrect dates (e.g. 201513)\n - Many of these date calculations need to be executed per request, so make your solution as performant as possible. The winner will be based on the fastest solution.\n\nThe output should be an integer representing the number of months between the two dates.\n\nExample: If the inputs were `201501` and `201412`, the output should be `1`. If the inputs were reversed the output should be `-1`.\n\n## Usage\n\nInstall dependencies, run tests\n\n```\n$ composer install\n$ vendor/bin/phpunit\n$ tests/speedtest\n```\n\n## Example Output\n\n```\n$ vendor/bin/phpunit ; tests/speedtest \nPHPUnit 4.8.6 by Sebastian Bergmann and contributors.\n\n................................................................. 65 / 90 ( 72%)\n.........................\n\nTime: 682 ms, Memory: 7.25Mb\n\nOK (90 tests, 90 assertions)\n\nGenerating code coverage report in HTML format ... done\nTesting algorithms with 48000 samples\n  'AlgorithmTimestamps'         1.146300 seconds\n  'AlgorithmSubstr'             0.230900 seconds\n  'AlgorithmModulus'            0.134983 seconds\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumpygump%2Fdistance-between-dates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumpygump%2Fdistance-between-dates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumpygump%2Fdistance-between-dates/lists"}