Hey there kirupians
I have a string of a date in a (‘YmdHis’) format ie: 20050102101215 is the 2nd of january, 2005 at 10:12. I like this format because it’s relatively easy to read, you can sort objects chronologically with it and it doesn’t contain words (‘wed,tue’,‘sep,oct’).
HOwever I have a problem converting it back to a proper date object. I’d like to use the mktime function to calculate date differences and all, but there’s nothing to help me turn 20050102101215 back into the proper date.
I was thinking along the lines of:
$oldate = '20050102101215'
$newdate = strftdate($olddate,'YmdHis','r,);
echo $olddate;
// prints Jan 2nd 2005, 10:12 am(GMT+1)
But can’t find the appropriate function to do so. Help
cheers,
mlk