{"id":16686384,"url":"https://github.com/stdevteam/yii-date","last_synced_at":"2025-04-10T00:16:26.208Z","repository":{"id":6554943,"uuid":"7796662","full_name":"stdevteam/yii-date","owner":"stdevteam","description":"Date and time related processing for Yii framework","archived":false,"fork":false,"pushed_at":"2022-11-30T12:35:05.000Z","size":12,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T00:16:17.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/stdevteam.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":"2013-01-24T11:35:30.000Z","updated_at":"2022-04-05T13:01:32.000Z","dependencies_parsed_at":"2023-01-11T20:09:46.970Z","dependency_job_id":null,"html_url":"https://github.com/stdevteam/yii-date","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/stdevteam%2Fyii-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevteam%2Fyii-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevteam%2Fyii-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdevteam%2Fyii-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdevteam","download_url":"https://codeload.github.com/stdevteam/yii-date/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131315,"owners_count":21052819,"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-10-12T15:05:42.724Z","updated_at":"2025-04-10T00:16:26.177Z","avatar_url":"https://github.com/stdevteam.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"yii-date\n========\n\nDate and time related processing for Yii framework\n\nSample usage within a controller\n========\n\nUse any of this methods as shown in the example below\n\n```php\n\u003c?php\n\nclass DateController extends Controller\n{\n\n\t/**\n\t * Illustrates the usage of Date component\n\t *\n\t */\n\tpublic function actionIndex(){\n\t\t//a sample date\n\t\t$date = '24-01-2022';\n\t\n\t\t//Returns current datetime formatted for MySQL with the timezone offset applied to it\n\t\techo Yii::app()-\u003eDate-\u003enow();\n\t\t\n\t\t//Returns current datetime formatted for MySQL without the timezone offset applied to it\n\t\techo Yii::app()-\u003eDate-\u003enow(false);\n\t\t\n\t\t\n\t\t//Formats almost any date string or timestamp to a MySQL compatible datetime string with the timezone offset applied to it\n\t\techo Yii::app()-\u003eDate-\u003etoMYSQL($date);\n\t\t\n\t\t//Formats almost any date string or timestamp to a MySQL compatible datetime string without the timezone offset applied to it\n\t\techo Yii::app()-\u003eDate-\u003etoMYSQL($date, false);\n\t\t\n\t\t\n\t\t//Returns the timestamp of current date in seconds with the timezone offset applied to it\n\t\techo Yii::app()-\u003eDate-\u003etimestamp();\n\t\t\n\t\t//Returns the timestamp of current date in seconds without the timezone offset applied to it\n\t\techo Yii::app()-\u003eDate-\u003etimestamp(false);\n\t\t\n\t\t\n\t\t//Returns a datetime string to add to database as default for datetime columns\n\t\techo Yii::app()-\u003eDate-\u003enullDateTime();\n\t\t\n\t\t\n\t\t////Returns a date string to add to database as default for date columns\n\t\techo Yii::app()-\u003eDate-\u003enullDate();\n\t\t\n\t\t\n\t\t//Given start and end dates in almost any format claculates the number of days within the interval\n\t\techo Yii::app()-\u003eDate-\u003edaysCount('10-02-2022', '24-01-2022');\n\t\t\n\t\t\n\t\t//Given a year or a date string returns the number of days that the year contains (365 or 366)\n\t\techo Yii::app()-\u003eDate-\u003edaysInYear($yearOrDate);\n\t\t\n\t\t\n\t\t//stop the execution\n\t\tYii::app()-\u003eend();\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevteam%2Fyii-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdevteam%2Fyii-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdevteam%2Fyii-date/lists"}