php3-list | 199901
Date: 01/12/99
- Next message: Jordan B. Baker: "[PHP3] RE: Date formatting."
- Previous message: Mark Musone: "Re: [PHP3] Objects vs. not"
- In reply to: Roger O. Svenning: "[PHP3] Date formatting."
- Next in thread: Richard Lynch: "RE: [PHP3] Date formatting."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, 12 Jan 1999, Roger O. Svenning wrote:
> How do I format a 14 digit TIMESTAMP in a Mysql DB to a more readable
> date format like (01-12-1999) ?
Try something like this:
$mysql_date = 'YYYY-MM-DD HH:mm:SS';
list($year,$month,$day,$hour,$minute,$second) = split('[- :]', $mysql_date);
$seconds_since_epoch = mktime($hour,$minute,$second,$month,$day,$year);
$pretty_date = date('d-m-Y',$seconds_since_epoch);
-adam
-- / adam maccabee trachtenberg | visit college life online \ \ adam <email protected> | http://www.student.com /-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev <email protected>
- Next message: Jordan B. Baker: "[PHP3] RE: Date formatting."
- Previous message: Mark Musone: "Re: [PHP3] Objects vs. not"
- In reply to: Roger O. Svenning: "[PHP3] Date formatting."
- Next in thread: Richard Lynch: "RE: [PHP3] Date formatting."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

