开发者

strotime() returning false on proper date formatted string?

Trying to format a date string using a technique I've used countless times, s开发者_C百科uddenly returning false (PHP5). Anyone run into this?

//$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?


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"

Taken from http://www.php.net/manual/en/datetime.formats.date.php

strtotime should work for the date you specified. Make sure the date going into your function is really in the format m d,y

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜