Found on GitHub: PrettyTimestamps

Octocat
Jon Hocking recently released a simple category on NSDate that generates relative timestamps such as “3 hours ago” or “2 days ago” from an NSDate instance.

The code is available on GitHub at jonhocking/PrettyTimestamp and is available as a CocoaPod as well.

I’ve put together an example project to demo how the code works at stevenhuey/PrettyDates. It makes use of CocoaPods to manage dependencies so make sure to use the .xcworkspace file and run:

pod install

before trying to build and run the app.

When you save yourself some time generating some nice relative timestamps in your next app make sure give @jonhocking a mention on Twitter.

Steven Huey

Steven Huey

Senior Software Engineer at Art & Logic
Mac and iOS developer and project manager at Art+Logic. Twitter | GitHub
Steven Huey

@stevehuey

Father of 4 |  Developer
@CastroSupport I’m seeing 500 and other errors like this in the app today. Are there server issues atm? https://t.co/rLJbd1QVRe - 4 days ago
Steven Huey

Tags:

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.