{"id":15031645,"url":"https://github.com/naoty/timepiece","last_synced_at":"2025-05-15T04:05:56.611Z","repository":{"id":19758423,"uuid":"23015874","full_name":"naoty/Timepiece","owner":"naoty","description":"Intuitive date handling in Swift","archived":false,"fork":false,"pushed_at":"2019-10-15T08:55:28.000Z","size":276,"stargazers_count":2625,"open_issues_count":8,"forks_count":146,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-05-15T04:05:49.036Z","etag":null,"topics":["date","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"bigbluebutton/bigbluebutton","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naoty.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-16T10:35:34.000Z","updated_at":"2025-03-24T17:52:57.000Z","dependencies_parsed_at":"2023-01-14T10:00:52.987Z","dependency_job_id":null,"html_url":"https://github.com/naoty/Timepiece","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoty%2FTimepiece","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoty%2FTimepiece/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoty%2FTimepiece/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naoty%2FTimepiece/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naoty","download_url":"https://codeload.github.com/naoty/Timepiece/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"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":["date","swift"],"created_at":"2024-09-24T20:16:15.411Z","updated_at":"2025-05-15T04:05:51.596Z","avatar_url":"https://github.com/naoty.png","language":"Swift","readme":"# Timepiece  [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Timepiece.svg)](https://cocoapods.org/pods/Timepiece) [![Build Status](http://img.shields.io/travis/naoty/Timepiece/master.svg?style=flat)](https://travis-ci.org/naoty/Timepiece)\nIntuitive date handling in Swift\n\n## Features\n* :bulb: **Intuitive**: Timepiece provides a set of helpers to make date handling easier.\n* :clock9: **Correct**: Using Foundation API correctly, Timepiece helps to calculate dates correctly without deep understanding.\n* :package: **Small**: Timepiece has only 4 file. You can read the inside of this easily.\n\n## Requirements\n\n* Swift 3.0+\n* iOS 8.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+\n\n## Usage\n\n### Initialization\n\n```swift\nDate(era: 235, year: 26, month: 8, day: 14, hour: 20, minute: 25, second: 43, nanosecond: 0, on: Calendar(identifier: .japanese))\nDate(year: 2014, month: 8, day: 14, hour: 20, minute: 25, second: 43, nanosecond: 0)\nDate(year: 2014, month: 8, day: 14, hour: 20, minute: 25, second: 43)\nDate(year: 2014, month: 8, day: 14)\n\nDate.today()\nDate.yesterday()\nDate.tomorrow()\n```\n\n### Calculation\n\n```swift\nnow + 1.year\nnow - 2.months\nnow + (3.weeks - 4.days + 5.hours)\n\n1.year.later\n1.year.ago\n```\n\n### Change\n\n```swift\nnow.changed(year: 2014)\nnow.changed(weekday: 1)\nnow.truncated([.minute, .second, .nanosecond])\nnow.truncated(from: .day)\n```\n\n### Formating\n\n```swift\nnow.stringIn(dateStyle: .long, timeStyle: .medium)\nnow.dateString(in: .medium)\nnow.timeString(in: .short)\n\n3.days.string(in: .full)\n```\n\n### Parsing\n\n```swift\n\"2014/8/14\".date(inFormat: \"yyyy/MM/dd\")\n\"2014-08-14T20:25:43+0900\".dateInISO8601Format()\n```\n\n## Installation\n\n### CocoaPods\n\n```ruby\n# Podfile\npod \"Timepiece\"\n```\n\n### Carthage\n\n```ruby\n# Cartfile\ngithub \"naoty/Timepiece\"\n```\n\n## Contribution\n\n1. Fork\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n## License\n\nTimepiece is available under the MIT license. See the LICENSE file for more info.\n\n## Author\n\n[naoty](https://github.com/naoty)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoty%2Ftimepiece","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoty%2Ftimepiece","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoty%2Ftimepiece/lists"}