{"id":18783689,"url":"https://github.com/tomkyle/datetime","last_synced_at":"2025-12-20T18:30:16.989Z","repository":{"id":15888132,"uuid":"18629373","full_name":"tomkyle/DateTime","owner":"tomkyle","description":"DateTime Helper classes for PHP ","archived":false,"fork":false,"pushed_at":"2014-04-10T17:15:41.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T11:45:34.932Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomkyle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-10T08:29:55.000Z","updated_at":"2014-04-10T17:15:40.000Z","dependencies_parsed_at":"2022-08-04T07:00:12.078Z","dependency_job_id":null,"html_url":"https://github.com/tomkyle/DateTime","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FDateTime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FDateTime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FDateTime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomkyle%2FDateTime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomkyle","download_url":"https://codeload.github.com/tomkyle/DateTime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239699579,"owners_count":19682574,"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-11-07T20:40:08.406Z","updated_at":"2025-12-20T18:30:16.936Z","avatar_url":"https://github.com/tomkyle.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#tomkyle/DateTime\n\nThis small package contains ~~some date and time related classes~~ for the time being a small class that creates a MySQL-ready string representation from a PHP DateTime object.\n\nAs you know, PHP's DateTime class already offers a [format method.](http://www.php.net/manual/en/datetime.format.php) But calling it  everytime you need it in MySQL context with that `Y-m-d H:i:s` parameter may be annoying (and feel unclean, somehow).\n\n\n##Usage\n```php\n\u003c?php\nuse \\tomkyle\\DateTime\\MySqlDateTimeFormatter;\n\n$now = new \\DateTime(\"now\");\n\n// prints s'th. like \"2014-04-09 15:00:00\"\necho new MySqlDateTimeFormatter( $now );\n\n// prints s'th. like \"2014-04-23 15:00:00\"\necho new MySqlDateTimeFormatter( new \\DateTime( \"14day\" ));\n```\n\nAs of PHP5.5, there is a [DateTimeInterface interface](http://www.php.net/manual/en/class.datetimeinterface.php) which would perfectly suit the Dependency Injection used here. I am quite confident there soon will be a PHP5.4 polyfill…\n\n##Installation via Composer\n\nInstall from command line or `composer.json` file:\n\n#####Command line\n    \n    composer require tomkyle/datetime\n\n#####composer.json\n    \"require\": {\n        \"tomkyle/datetime\": \"~1.0\"\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fdatetime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomkyle%2Fdatetime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomkyle%2Fdatetime/lists"}