1
function test()
{
echo time();
echo "<hr>";
echo $this->get_date(time());
}
和另一功能時間()函數(FY的升JS 一個噸G:I:S A)格式
function get_date($timestamp)
{
$the_date = date('l jS \of F Y \a\t G:i:s A', $timestamp);
return $the_date;
}
當我使用的測試功能的時間()函數提供了一個有效的結果,但生成的時間戳是關閉了2小時 例如。如果時間()是1491118740,那麼時間戳格式應該是2017年4月2日星期日上午7:39:00,但我將在2017年4月2日星期日上午9:39:00獲取如何解決此問題?請幫助..並提前致謝... PS。檢查時間戳值,你可以使用本網站使用date_default_timezone_set()
示例腳本使用http://www.unixtimestamp.com/index.php
結賬,如果有時差 – hassan