RE: [PHP] How to convert '2001032018' - '2001 03 20 18' ? (Fomating Date)

2001-03-20 Thread Altunergil, Oktay
function sql_to_unix_time($timeString) { return mktime(substr($timeString, 8,2), substr($timeString, 10,2), substr($timeString, 12,2), substr($timeString, 4,2), substr($timeString, 6,2), substr($timeString, 0,4)); } you can use the above

RE: [PHP] How to convert '2001032018' - '2001 03 20 18' ? (Fomating Date)

2001-03-20 Thread Hoover, Josh
You could try this: function convertTimeStamp($yourTimeStamp) { $strTime[0] = substr($yourTimeStamp, 0,4); $strTime[1] = substr($yourTimeStamp, 4,2); $strTime[2] = substr($yourTimeStamp, 6,2); $strTime[3] = substr($yourTimeStamp, 8,2); return $strTime; }