使用 gmdate 给出了错误的日期

发布于 2024-12-13 03:20:42 字数 241 浏览 4 评论 0原文

我正在制作一个 mediawiki 扩展,试图打印文章时间戳

$timestamp = $myArticle->getTimestamp();
$time = gmdate("D, d M Y H:i:s",$timestamp);

,问题是时间戳是:20110807230546,

但给定时间是:2038 年 1 月 19 日星期二 03:14:07

为什么?

i am making a mediawiki extension , trying to print the Article timestamp

$timestamp = $myArticle->getTimestamp();
$time = gmdate("D, d M Y H:i:s",$timestamp);

the problem that the timestamp is : 20110807230546

but the given time is : Tue, 19 Jan 2038 03:14:07

why ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

Spring初心 2024-12-20 03:20:42
echo gmdate('D, d M Y H:i:s', strtotime($timestamp));
echo gmdate('D, d M Y H:i:s', strtotime($timestamp));
满地尘埃落定 2024-12-20 03:20:42

使用wfTimestamp()

$time = wfTimestamp( TS_RFC2822, $timestamp );

Use wfTimestamp():

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