可以从unix时间戳中读取日期吗?

发布于 2024-10-03 18:43:43 字数 292 浏览 0 评论 0原文

从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱花细雨 2024-10-10 18:43:43

这已经被问过好几次了。最后一个链接是 iphone 专用的,其他的则更通用一些。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文