Hi All,
Any thoughts on the easiest way to translate a MySQL timestamp (which looks
like 20040422090941) to the datetime format (which looks like 2004-04-22
09:09:41). This is just to make it easier for a human to read it.
I have thought about splitting it into chunks using something like
str_split, then piecing it back together, but it seems like there should be
an easier way. And also, I am not running PHP5.
I already tried date("Y-m-d H:i:s",strtotim e("200404220909 41")), and had no
luck. strtotime cannot handle that format.
This seems like the sort of thing you should be able to do in 1 line of
code. Any pointers?
-Josh
Any thoughts on the easiest way to translate a MySQL timestamp (which looks
like 20040422090941) to the datetime format (which looks like 2004-04-22
09:09:41). This is just to make it easier for a human to read it.
I have thought about splitting it into chunks using something like
str_split, then piecing it back together, but it seems like there should be
an easier way. And also, I am not running PHP5.
I already tried date("Y-m-d H:i:s",strtotim e("200404220909 41")), and had no
luck. strtotime cannot handle that format.
This seems like the sort of thing you should be able to do in 1 line of
code. Any pointers?
-Josh
Comment