可以从unix时间戳中读取日期吗?
从 int 变量 unix 时间戳(类似于 1290341015)开始,有没有办法将其转换为人类可读的日期字符串? iPhone 邮件应用程序具有理想的日期显示功能,它显示当前时间上下文中的时间或日期。
06:47 (a time today)
Yesterday (received yesterday)
Friday (received last Friday)
09/11/2010 (received more than a week ago)
有没有办法近似这个?
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 yesterday)
Friday (received last Friday)
09/11/2010 (received more than a week ago)
Is there a way to approximate this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这已经被问过好几次了。最后一个链接是 iphone 专用的,其他的则更通用一些。
This has been asked quite a few times before. The final link is the iphone specific one, the others a bit more general.