RE: [PHP] Time problem
| From: | Vail, Warren | Date: | Wed, 12 Nov 2003 00:44:31 +0000 |
| Subject: | RE: [PHP] Time problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-169217@lists.php.net to get a copy of this message | ||
Not sure how others would tackle this, but I would use something like
$readabledate = date("dS F Y @ H:i:s",
strtotime(substr($timestamp,0,4)."-"
.substr($timestamp,4,2)."-"
.substr($timestamp,6,2)." "
.substr($timestamp,8,2).":"
.substr($timestamp,10,2).":"
.substr($timestamp,12,2)));
Not sure this is bug free, but it should change your timestamp (yes it is a
database timestamp) into the readable format you described. It's yours to
debug.
http://www.php.net/manual/en/function.date.php
Good luck,
Warren Vail
-----Original Message-----
From: Erin [mailto:xp@cookra.co.uk]
Sent: Tuesday, November 11, 2003 4:00 PM
To: php-general@lists.php.net
Subject: [PHP] Time problem
Hi All,
Sorry if this has been asked a 1000 times and if its easy to find in the
php manual but i cant seam to solve this.
How do i convert a timestamp in to a normal readable time & date ie
20031111155023
into
11th November 2003 @ 15:50:23
Many thanks, thought id ask someone is bound to have a snippet for this.
Regards
All
Erin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php