{"id":13524631,"url":"https://github.com/hotchemi/khronos","last_synced_at":"2025-04-09T11:10:55.797Z","repository":{"id":148680269,"uuid":"54334986","full_name":"hotchemi/khronos","owner":"hotchemi","description":"An intuitive Date extensions in Kotlin.","archived":false,"fork":false,"pushed_at":"2020-02-11T05:10:27.000Z","size":573,"stargazers_count":326,"open_issues_count":7,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T03:58:31.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://hotchemi.github.io/khronos","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hotchemi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-20T19:02:15.000Z","updated_at":"2024-11-05T22:52:56.000Z","dependencies_parsed_at":"2023-08-26T09:31:14.776Z","dependency_job_id":null,"html_url":"https://github.com/hotchemi/khronos","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotchemi%2Fkhronos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotchemi%2Fkhronos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotchemi%2Fkhronos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hotchemi%2Fkhronos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hotchemi","download_url":"https://codeload.github.com/hotchemi/khronos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027407,"owners_count":21035594,"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-08-01T06:01:11.900Z","updated_at":"2025-04-09T11:10:55.757Z","avatar_url":"https://github.com/hotchemi.png","language":"Kotlin","readme":"# khronos\n\n![Build Status](https://github.com/hotchemi/khronos/workflows/build/badge.svg) [![Download](https://api.bintray.com/packages/hotchemi/maven/khronos/images/download.svg) ](https://bintray.com/hotchemi/maven/khronos/_latestVersion) [![License](https://img.shields.io/badge/license-APACHE2-green.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)\n\nAn intuitive Date extensions in Kotlin.\n\n## Usage\n\n### Add durations to date\n\n```kotlin\nval today = Dates.today\nval nextWeek = today + 1.week\nval dayBeforeYesterday = today - 2.days\n\n// shortcuts #1\nval tomorrow = Dates.tomorrow\nval yesterday = Dates.yesterday\n\n// shortcuts #2\nval yesterday = 1.days.ago\nval fiveYearsSince = 5.years.since\n```\n\n### Initialize by specifying date components\n\n```kotlin\nval birthday = Dates.of(year = 1990, month = 1, day = 21)\nval firstCommitDate = Dates.of(year = 2016, month = 2, day = 26, hour = 18, minute = 58, second = 31, millisecond = 777)\n```\n\n### Initialize by changing date components\n\n```kotlin\nval today = Dates.today\nval christmas = today.with(month = 12, day = 25)\nval thisSunday = today.with(weekday = 1)\n\n// shortcuts\nval newYearDay = today.beginningOfYear\nval newYearsEve = today.endOfYear\n```\n\n### Check day of the week\n\n```kotlin\nDates.today.isFriday() // false\n```\n\n### Format and parse\n\n```kotlin\n5.minutes.since.toString(\"yyyy-MM-dd HH:mm:ss\")\n//=\u003e \"2015-03-01 12:05:00\"\n\n\"1987-06-02\".toDate(\"yyyy-MM-dd\")\n//=\u003e Dates.of(year = 1987, month = 6, day = 2)\n```\n\n### Compare dates\n\n```kotlin\n1.day.ago \u003e 2.days.ago // true\n1.day.ago in 2.days.ago..Dates.today // true\n```\n\n## Install\n\n`${latest.version}` = [![Download](https://api.bintray.com/packages/hotchemi/maven/khronos/images/download.svg) ](https://bintray.com/hotchemi/maven/khronos/_latestVersion)\n\n```groovy\ndependencies {\n  compile 'com.github.hotchemi:khronos:${latest.version}'\n}\n```\n\n## Notice\n\n- khronos is definitely inspired by [naoty/Timepiece(Swift)](https://github.com/naoty/Timepiece).\n\n## Licence\n\n```\nCopyright 2016 Shintaro Katafuchi\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["开源库和框架","Kotlin","etc"],"sub_categories":["其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhotchemi%2Fkhronos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhotchemi%2Fkhronos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhotchemi%2Fkhronos/lists"}