我已經創建了一個博客並設置了它,以便在每個博客文章中顯示該博文的發佈日期,我總是使用stroftime()並獲取記錄來自存儲帖子的MySQL數據庫的日期。stroftime代碼不會在新的web服務器上顯示日期
這一直工作,但我剛剛換了新的虛擬主機,當我嘗試使用原來的代碼:
<?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()替換。