note 11024 deleted from ref.datetime by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 11:52:58 +0000 |
| Subject: | note 11024 deleted from ref.datetime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56075@lists.php.net to get a copy of this message | ||
Note Submitter: mgidman@corp.christianity.com
----
in jmat's example above
function mysql_to_epoch ($datestr) {
list($year,$month,$day,$hour,$minute,$second) = split("([^0-9])",$datestr);
return date("U",mktime($hour,$minute,$second,$month,$day,$year));
}
If your $datestr has quotes around it you will need to add a placeholder to the list.
Ex:
list($junk,$year,$month,$day,$hour,$minute,$second) = split("([^0-9])",$datestr);