{"id":29829864,"url":"https://github.com/chrynan/time","last_synced_at":"2025-07-29T09:41:34.109Z","repository":{"id":39716089,"uuid":"239359126","full_name":"chRyNaN/time","owner":"chRyNaN","description":"A Kotlin multi-platform time library.","archived":false,"fork":false,"pushed_at":"2022-11-19T05:42:05.000Z","size":610,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-02-27T06:41:52.762Z","etag":null,"topics":["duration","kotlin","kotlin-library","kotlin-multi-platform","kotlin-multiplatform","library","time","timestamp","timezone"],"latest_commit_sha":null,"homepage":"","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/chRyNaN.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-02-09T19:12:35.000Z","updated_at":"2022-11-23T17:12:56.000Z","dependencies_parsed_at":"2022-09-21T03:01:09.429Z","dependency_job_id":null,"html_url":"https://github.com/chRyNaN/time","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/chRyNaN/time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Ftime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Ftime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Ftime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Ftime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chRyNaN","download_url":"https://codeload.github.com/chRyNaN/time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Ftime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267665373,"owners_count":24124522,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"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":["duration","kotlin","kotlin-library","kotlin-multi-platform","kotlin-multiplatform","library","time","timestamp","timezone"],"created_at":"2025-07-29T09:41:25.062Z","updated_at":"2025-07-29T09:41:34.100Z","avatar_url":"https://github.com/chRyNaN.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# time\n\nA Kotlin multi-platform time library. \u003cbr/\u003e\n\n\u003cimg alt=\"GitHub tag (latest by date)\" src=\"https://img.shields.io/github/v/tag/chRyNaN/time\"\u003e\n\nThis library expands on the Kotlin [Duration](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-duration/)\nand [kotlinx.datetime](https://github.com/Kotlin/kotlinx-datetime) library.\n\nAn early look into the development of this library is discussed in [this article](https://chrynan.codes/its-about-time/)\nwhich was featured in Android Weekly issue [#401](https://androidweekly.net/issues/issue-401).\n\u003ca href=\"https://androidweekly.net/issues/issue-401\" title=\"Android Weekly Issue 401\"\u003e\n\u003cimg alt=\"Badge\" src=\"https://androidweekly.net/issues/issue-401/badge\" height=\"20px\"\u003e\u003c/img\u003e\n\u003c/a\u003e\n\nNote that this library has changed focus since [this article](https://chrynan.codes/its-about-time/) was written,\nbecause the [kotlinx.datetime](https://github.com/Kotlin/kotlinx-datetime) library has been introduced since then.\n\n## Using the Library\n\nThis library expands on the kotlinx datetime library by providing additional components and utilities, including:\n\n* [UtcMillisSinceEpoch](docs/time-core/time-core/com.chrynan.time/-utc-millis-since-epoch/index.md)\n* [DateTimeStamp](docs/time-core/time-core/com.chrynan.time/-date-time-stamp/index.md)\n* [DateStamp](docs/time-core/time-core/com.chrynan.time/-date-stamp/index.md)\n* [TimeProvider](docs/time-core/time-core/com.chrynan.time/-time-provider/index.md)\n* [DateTimeFormatter](docs/time-core/time-core/com.chrynan.time/-date-time-formatter/index.md)\n\n### TimeProvider\n\nA `TimeProvider` extends from `kotlin.time.TimeSource` and `kotlinx.datetime.Clock`. This may provide additional\nfunctionality in the future. A `TimeProvider` can be obtained via the `TimeProvider` function:\n\n```kotlin\nval timeProvider = TimeProvider()\n\nval duration = timeProvider.elapsedSystemTime\n```\n\n### TimeFormatter\n\nThe `TimeFormatter` interface provides a way to format time values:\n\n```kotlin\nval formatter = TimeFormatter(\"EEEE, MMM d, yyyy\")\n\nformatter.invoke(instant, timeZone)\n```\n\n### Coroutines\n\nThe library provides common coroutines and Flow time based utilities, such as the following:\n\n```kotlin\nintervalFlow(period = 30.seconds)\n\ntimerFlow(duration = 2.minutes)\n\nscheduleFlow(dateTimeString)\n\nmyFlow.timeout(30.seconds)\n\nmyFlow.timedValue()\n\npoll(period = 10.seconds) { myFlow }\n```\n\nRefer to the `FlowUtils` Kotlin file in the `time-core` package for more information on the functions.\n\n## Building\n\nThe library is provided through [repsy](https://repsy.io). Refer to\nthe [releases page](https://github.com/chRyNaN/time/releases) for the latest version. \u003cbr/\u003e\n\u003cimg alt=\"GitHub tag (latest by date)\" src=\"https://img.shields.io/github/v/tag/chRyNaN/time\"\u003e\n\n### Repository\n\n```groovy\nrepositories {\n    maven { url = uri(\"https://repo.repsy.io/mvn/chrynan/public\") }\n}\n```\n\n### Dependencies\n\n```groovy\nimplementation(\"com.chrynan.time:time-core:$VERSION\")\n```\n\n## Documentation\n\nRefer to the [docs](docs) folder for documentation and more information about the library.\n\n## License\n\n```\nCopyright 2021 chRyNaN\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Ftime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrynan%2Ftime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Ftime/lists"}