I am new to PHP and I am trying to learn more about php date and time, but I seem to be stuck with this.
I have this date format:
ddMMyyHHmmss
And the example is 120813125055, but I'm trying to manipulate a string so that it gives me the format:
yyyy-MM-dd HH:mm:ss (in the example above, 2013-08-12 12:50:55)
I tried to do something like:
date('Ymd H:i:s', strtotime('120813125055'));
But it always gives me the result 1969-12-31 18:00:00.
I suppose I need to do some string manipulation in PHP for this, but I was wondering if there is a simpler and more efficient way to do this?
source share