How can I format a date in Objective-C similar to the jquery.timeago library?

前端 未结 9 2010
说谎
说谎 2020-12-29 05:57

I have a feed of items displayed in table cells, part of which is a date / timestamp in the past.

In Objective-C, how can I accomplish formatting them in the same m

9条回答
  •  心在旅途
    2020-12-29 06:30

    I wrote an NSDate category that returns time deltas in a human readable format (e.g., "4 weeks, 2 days"). You can download it here and tweak it to your needs: https://github.com/chriscdn/RHTools (look for NSDate+timesince).

提交回复
热议问题