尝试使用我无数次使用的技术格式化日期字符串,突然返回false(PHP5)。有人碰到这个吗?
//$new_date = June 14,2010
echo $new_date;
$new_date = date("F j, Y", strtotime($new_date));
//returns the infamous December 31, 1969 because strototime() is returning false?
答案 0 :(得分:0)
Type of string | REGEX | EXAMPLE
Textual month, day and year | m ([ .\t-])* dd [,.stndrh\t ]+ y | "July 1st, 2008", "April 17, 1790", "May.9,78"
取自http://www.php.net/manual/en/datetime.formats.date.php
strtotime
应该适用于您指定的日期。确保进入函数的日期格式为m d,y