Page 1 of 1

date format question

Posted: Mon Mar 27, 2006 1:32 am
by basher400
Hi

I have this time stamp:
20051107065122

I'm trying to parse it into something like this:
Nov 07 2005, 06:51:22

I've tried the following:

Code: Select all

echo date("M d Y H:i:s", "20051107065122" );
echo gmdate("M d Y H:i:s", "20051107065122" ));
either of the above give me:
Jan 19 2038 03:14:07



what am I doing wrong?

Posted: Mon Mar 27, 2006 1:44 am
by feyd
it's not a unix timestamp, which is what PHP expects. You'll have to break it apart using substr()