tags:

views:

57

answers:

1

Trying to format a date string using a technique I've used countless times, suddenly 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?
A: 
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

Bob Fincheimer