-
Dates in YYYYMMDDHHMMSS
Hi,
I'm storing dates like "YYYYMMDDHHMMSS" so they can be numericaly sorted.
I'm wondering how i could get the day of the week and suffix (th, nd, etc) from an integer in that format.
I've searched the php website a few times but havent had any luck with this so please dont point me over to links on their site.
One thing I did see referenaced many times were unix timestamps and php timestamps, but in no place does it explain what the format of them are! (Which is partly why the php website hasnt been any help)
Thanks in advance
-
unix timestamps are just the number of seconds since Jan 1st 1970 which explains why they are quite a few numbers long ;)
Just use the PHP function strtotime() on the stored value
PHP Code:
<?php
$date = '2002-08-29 00:07';
echo date('l dS F', strtotime($date));
?>
-
echo date('l dS F', strtotime(substr($tmpdate,0,8))); worked, thanks.