Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hemangshah/Datify
Easypeasy date functions. 🕛
https://github.com/hemangshah/Datify
date date-extension datify swift swift-date-extension
Last synced: about 1 month ago
JSON representation
Easypeasy date functions. 🕛
- Host: GitHub
- URL: https://github.com/hemangshah/Datify
- Owner: hemangshah
- License: mit
- Created: 2017-06-06T10:35:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-06T11:38:51.000Z (over 6 years ago)
- Last Synced: 2024-04-22T12:30:40.439Z (8 months ago)
- Topics: date, date-extension, datify, swift, swift-date-extension
- Language: Swift
- Homepage:
- Size: 6.84 KB
- Stars: 43
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - Datify - Easypeasy date functions. (Libs / Date)
- awesome-swift - Datify - Easypeasy date functions. (Libs / Date)
- awesome-swift - Datify - Easypeasy date functions. (Date [🔝](#readme))
- awesome-swift - Datify - Easypeasy date functions. (Libs / Date)
README
# Datify 🕛
Easypeasy date functions.
![License](https://img.shields.io/badge/License-MIT-lightgrey.svg)
![Platform](https://img.shields.io/badge/Platforms-iOS-red.svg)
![Swift 3.x](https://img.shields.io/badge/Swift-3.x-blue.svg)
![MadeWithLove](https://img.shields.io/badge/Made%20with%20%E2%9D%A4-India-green.svg)
[![Awesome-Swift](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/matteocrippa/awesome-swift/)Usage:
````swift
print("now: \(Date.init())")
print("8 days later: \(8.days.fromNow)")
print("2 weeks before: \(2.weeks.ago)")
print("5 days, 3 month later: \((5.days + 3.months).fromNow)")
````
Output:
now: 2017-06-06 10:42:23 +0000
8 days later: 2017-06-14 10:42:23 +0000
2 weeks before: 2017-05-23 10:42:23 +0000
5 days, 3 month later: 2017-09-11 10:42:23 +0000
Note:This library was originally written as [SwiftDateTimeExtensions](https://github.com/schluete/SwiftDateTimeExtensions) but it was too old for new Swift version and needed improvements.
I am also planning to add more features to this class in future thus created a separate repo instead a fork.