note 84633 deleted from function.strtotime by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:02:33 +0000 |
| Subject: | note 84633 deleted from function.strtotime by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196756@lists.php.net to get a copy of this message | ||
Note Submitter: rohanshenoy at w3hobbyist dot com
----
This function can be used to convert the timestamp generated by MySQL NOW() function into UNIX
timestamp. Example:
Lets say MySQL NOW() returns '2008-07-23 06:07:42'.
<?php
$mysql_now='2008-07-23 06:07:42';
$time=strtotime($mysql_now);
echo date(d M y, H:i:s,$time);
//outputs: 23 Jul 08, 06:07:42
?>
Please note that the timestamp returned by mysql NOW() function may be the in the timezone of the
server on which it was generated, and not always in GMT.