Re: timestamp problem !!
| From: | Chris Boget | Date: | Mon, 14 Jul 2003 20:05:39 +0000 |
| Subject: | Re: timestamp problem !! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155162@lists.php.net to get a copy of this message | ||
> <?php
> $timy = '20030714012548'; // time stamp from MySQL
> echo strtotime = ($timy);
> $date = ("Y-m-d" , $timy);
> ?>
You are so very close!
<?php
$timy = '20030714012548'; // time stamp from MySQL
echo strtotime = ($timy);
$date = date("Y-m-d" , strtotime( $timy ));
?>
$timy isn't a unix timestamp, which is what date() is expecting.
Chris