Projects
View on GitHub Timepiece
naoty/Timepiece
naoty/Timepiece has 2,602 GitHub stars and 141 forks. GitHot measured -1 stars in 24 hours. Last checked 2026-11-07 20:09 UTC. Last push 2019-10-15.
Intuitive date handling in Swift
What you can do
- :bulb: Intuitive: Timepiece provides a set of helpers to make date handling easier.
- :clock9: Correct: Using Foundation API correctly, Timepiece helps to calculate dates correctly without deep understanding.
- :package: Small: Timepiece has only 4 file. You can read the inside of this easily.
Measured star growth
- in 24h
- -1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalTimepiece

Intuitive date handling in Swift
Features
- :bulb: Intuitive: Timepiece provides a set of helpers to make date handling easier.
- :clock9: Correct: Using Foundation API correctly, Timepiece helps to calculate dates correctly without deep understanding.
- :package: Small: Timepiece has only 4 file. You can read the inside of this easily.
Requirements
- Swift 3.0+
- iOS 8.0+ / macOS 10.9+ / tvOS 9.0+ / watchOS 2.0+
Usage
Initialization
Date(era: 235, year: 26, month: 8, day: 14, hour: 20, minute: 25, second: 43, nanosecond: 0, on: Calendar(identifier: .japanese))
Date(year: 2014, month: 8, day: 14, hour: 20, minute: 25, second: 43, nanosecond: 0)
Date(year: 2014, month: 8, day: 14, hour: 20, minute: 25, second: 43)
Date(year: 2014, month: 8, day: 14)
Date.today()
Date.yesterday()
Date.tomorrow()
Calculation
now + 1.year
now - 2.months
now + (3.weeks - 4.days + 5.hours)
1.year.later
1.year.ago
Change
now.changed(year: 2014)
now.changed(weekday: 1)
now.truncated([.minute, .second, .nanosecond])
now.truncated(from: .day)
Formating
now.stringIn(dateStyle: .long, timeStyle: .medium)
now.dateString(in: .medium)
now.timeString(in: .short)
3.days.string(in: .full)
Parsing
"2014/8/14".date(inFormat: "yyyy/MM/dd")
"2014-08-14T20:25:43+0900".dateInISO8601Format()
Installation
CocoaPods
# Podfile
pod "Timepiece"
Carthage
# Cartfile
github "naoty/Timepiece"
Contribution
- Fork
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
License
Timepiece is available under the MIT license. See the LICENSE file for more info.
Author
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,993 starspublic-apis/public-apis
A collective list of free APIs
497,246 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
442,990 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,188 stars