EDIT
Per the comment below, here’s my attempt at splitting / combining / converting the string prior to implementing mktime…
$date1 = explode("T",'2005-03-27T00:00:00');
$date2 = explode("-", $date1[0]);
$try = mktime($time1,$time2,0,$date2[1],$date[2],$date[3]);
print $try;
// Prints out: 951793200
Original Question:
I’ve inherited a database and would like very much to convert the bizarre way the data is stored to something more mysql-friendly…
In the meantime, I get a text string (yes… text)… That I’d like to convert to unixtime…
So, I’ll get a string that looks like this:
2005-03-27T00:00:00 03:00 AM
I’d like to convert it to:
1111885200
Dates and times always mess me up… I’ve done a number of things using strtotime and mktime, but can’t get it formatted the way I want.
Well, this is how I would do it.
But, your desired result does not seem to be correct based on the date you posted.
OUTPUT