Wed, 13 Aug 2008 15:04:17 -0700
...and what functions can I put it in to make use of it?
strtotime doesnt make any sense of it
Looks like a RFC2822 date format. You could try using [man]strftime[/man] to parse it (see this user note).
I tested strtotime() and it correctly returns a timestamp for that date format.
this worked:
(string) date("D, j M Y g:i:s A", strtotime($item->pubDate));
now... is there anyway to detect if something is a valid date... id like to validate the data coming from the XML feed im using
strtotime() returns FALSE on an invalid date.
perfect... ill have to test that and work it into my security schema
not working:
$date = strtotime($item->pubDate.'abc'); if($date == TRUE) { echo "Good Date"; } else { echo "Bad Date" }
returns "Good Date"
It must discard excess fields if it finds a valid date first.
in that case... i think that should suffice... if i mash the keyboard instead of ABC it will return Bad Date...