<?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()是一样的.
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!