开发者

Readable date from unix time stamp?

Starting out with an int variable unix time stamp (something like 1290341015), is there a way to get this into a nice human readable date string? The iPhone Mail app has the ideal display of date, where it shows the time or date in the context of the current time.

06:47       (a time today)
Yesterday   (received yeste开发者_Go百科rday)
Friday      (received last Friday)
09/11/2010  (received more than a week ago)

Is there a way to approximate this?


  • Calculate relative time in C#
  • Fuzzy date algorithm
  • iPhone: Convert date string to a relative time stamp

This has been asked quite a few times before. The final link is the iphone specific one, the others a bit more general.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜