Skip to content

parth0072/KPTimeAgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KPTimeAgo

Platform iOS 11

Swift 4 compatible

License MIT

CocoaPods compatible

CocoaPods Install

Add this to your Podfile.

pod 'KPTimeAgo'

Manual Install

Just Drag and drop KPTimeAgo to your project.

Usage

First Step - import KPTimeAgo to your project

let timeAgo = (Date().formatDateAsTimeAgo()) 
print(timeAgo)
//Just now

Other Example
//August 25 at 10:30 AM
//July 25
//September 25
//July 25, 2022
//October 25
//July 25, 2023


Custom date format 
let timeAgo = KPTimeAgo.init(date: self.dateForComponents { $0.year = +6 }!, yesterdayFormat: nil, lastWeekFormat: nil, lastMonthFormat: nil, otherFormat: "LLLL d, yyyy")
print(timeAgo.formatDateAsTimeAgo())  //August 9, 2026 


Collaboration

Feel free to collaborate with ideas, issues and/or pull requests.

Contact

License

KPTimeAgo is released under the MIT License.

About

Relative Time ago formate

Resources

License

Stars

Watchers

Forks

Packages

No packages published