ios - How to get time interval as seen in message from a NSDate Eg 2m, 3h, Tuesday, 2014-06-01 -
is there framework or api give time time interval 2m, 3h, tuesday, 2014-06-01 given nsdate current nsdate. it's used in imessages , mail service app. it's used in other apps, seeing if there framework before seek write 1 myself.
i suggest utilize this category. helpful looking for.
for illustration line of code:
nsstring *displaystring = [nsdate stringfordisplayfromdate:date]; produces next kinds of output:
- ‘3:42 am’ – if date after midnight today - ‘tuesday’ – if date within lastly 7 days - ‘mar 1’ – if date within current calendar year - ‘mar 1, 2008’ – else ;-) ios time nsdate intervals messages
No comments:
Post a Comment