Timepiece is an open source Swift library from Naoto Kaneko for working with dates with clean and intuitive syntax that works with iOS, macOS, tvOS and watchOS.
In addition to simple date creation Timepiece supports date calculations, formatting, and parsing of dates.
These code snippets from the readme show the syntax of using Timepiece:
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)
now + 1.year
now - 2.months
now + (3.weeks - 4.days + 5.hours)
now.string(inDateStyle: .long, andTimeStyle: .medium)
You can find Timepiece on Github here.
A nice Swift library for working with dates.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.