如何将 Unix 时间戳转换回时间? [英] How can I convert a Unix timestamp back to time?

查看:35
本文介绍了如何将 Unix 时间戳转换回时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下 Unix 时间戳.

I have the following Unix timestamps.

1301982430 1301982430 1301981474

1301982430 1301982430 1301981474

1301981466 1301981466 1301981066

1301981466 1301981466 1301981066

1301981058 1301981058 1301980388

1301981058 1301981058 1301980388

1301980373 1301980373 1301979082

1301980373 1301980373 1301979082

1301978478 1301978478 1301978478

1301978478 1301978478 1301978478

如何将其转换回人类友好的时间?

How do I convert it back to time that's human friendly?

这似乎不起作用,

strtotime($item->timestamp);

推荐答案

可以使用php date函数获取日期和时间.

You can use the php date function to get the date and time.

echo date('Y-m-d h:i:s',$item->timestamp);

这篇关于如何将 Unix 时间戳转换回时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆