|
<?php
echo strtotime ("now"), "/n";
echo strtotime ("10 September 2000"), "/n";
echo strtotime ("+1 day"), "/n";
echo strtotime ("+1 week"), "/n";
echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "/n";
echo strtotime ("next Thursday"), "/n";
echo strtotime ("last Monday"), "/n";
?><?php
$str = 'Not Good';
if (($timestamp = strtotime($str)) === -1) {
echo "The string ($str) is bogus";
} else {
echo "$str == ". date('l dS of F Y h:i:s A',$timestamp);
}
?>
這個效果和用mktime()是一樣的.
php技術(shù):php strtotime 函數(shù)UNIX時間戳,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。