【发布时间】:2016-04-22 12:52:54
【问题描述】:
我创建了一个博客并进行了设置,以便在每篇博客文章中显示该文章的发布日期,我总是使用 stroftime() 并从帖子所在的 MySQL 数据库中获取记录的日期存储。
这一直有效,但我最近刚切换到一个新的网络主机,当我尝试使用原始代码时:
<?php $date = strtotime($post['post_date']);
echo date('F jS, Y', $date); ?>
我收到一条错误消息:
Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
我只是不明白他们想让我用 date_default_timezone_set() 替换哪里。
【问题讨论】:
标签: php mysql database mysqli strtotime