A high performant Swift Date Extension for creating, comparing, or modifying dates.
Capabilities
- Date from String
- Using date detection i.e.
"Tomorrow at 5:30 PM"
- With predefined format: i.e.
.isoDateTime
- With custom format: i.e.
"dd MMM yyyy HH:mm:ss"
- Using date detection i.e.
- String from Date
- With predefined format: i.e.
.rss
- With custom format: i.e.
""MMM d, yyyy""
- With combined date and time style: i.e.
.medium
- With individual date and time style: i.e.
.medium, .short
- With predefined format: i.e.
- Modify Date
- Offset date component: i.e.
.offset(.second, value: 110)
- Adjust date component: i.e.
.adjust(hour: 12, minute: 0, second: 0)
- Adjust date to a predefined time: i.e.
.adjust(for: .startOfDay)
- Offset date component: i.e.
- Compare Date
- Compare against relative date in predefined format: i.e.
.isToday, .isThisWeek
- Compare againnst target date: i.e.
firstDate.compare(.isSameMonth(as: secondDate))
- Compare against relative date in predefined format: i.e.
- Time Since
- Time since target date in component: i.e.
Date().since(secondDate, in: .second)
- Time since target date in component: i.e.
- Extras
- Extract date and time components: i.e.
.hour, .minute, .day
- Conveniance methods: i.e.
numberOfDaysInMonth(), firstDayOfWeek(), .lastDayOfWeek()
- Extract date and time components: i.e.
Date From String
Provides initializers to create a Date from a String