note 60585 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 15 Jul 2007 12:40:28 +0000 |
| Subject: | note 60585 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128561@lists.php.net to get a copy of this message | ||
Note Submitter: jeremy at citiesunlimited dot com
----
There doesn't seem to be enough documentation about this feature of strtotime(), but it can
take a SQL datetime column and convert it to a unix timestamp.
For example:
<?php
$timestamp = strtotime('2006-01-10 16:09:30');
echo($timestamp);
// outputs: 1136930970
?>
This is useful with the Date() Function:
<?php
$timestamp = strtotime('2006-01-10 16:09:30');
echo date('n/j/Y g:i:sa', $timestamp);
// outputs: 1/10/2006 4:09:30pm
?>