开发者

Readable date from unix time stamp?

开发者 https://www.devze.com 2023-01-25 23:23 出处:网络
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, whe

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

精彩评论

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