如何将java时间戳转换为php时间戳? [英] How to convert java timestamp to php timestamp?

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

问题描述

如何将像这个 1335997853142 这样的Java时间戳转换为php可以读取的格式?
1335997853142 应为 2012年5月2日22:30:53

how can I convert a Java timestamp like this one 1335997853142 to a format that php can read? 1335997853142 should be 02 May 2012 22:30:53.

但我尝试过什么错误或PHP说 1970-01-01 01:00:00 2038- 01-19 04:14:07

But what ever I try I get errors or PHP says 1970-01-01 01:00:00 or 2038-01-19 04:14:07

PLS帮助!!!我正在寻找超过1.5小时的解决方案!

PLS help!!! I'm searching for over 1.5h for a soloution!

推荐答案

PHP时间戳是秒,而不是毫秒。

PHP timestamps are seconds, not milliseconds.

echo gmdate("d M Y H:i:s",1335997853);

输出 2012年5月2日22:30:53

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

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