|
-
Aug 28th, 2002, 04:40 PM
#1
Thread Starter
Addicted Member
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
-
Aug 28th, 2002, 06:10 PM
#2
PowerPoster
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));
?>
-
Aug 28th, 2002, 07:25 PM
#3
Thread Starter
Addicted Member
echo date('l dS F', strtotime(substr($tmpdate,0,8))); worked, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|