note 26209 deleted from function.mktime by vincent
| From: | vincent@php.net | Date: | Wed, 10 Sep 2003 19:17:18 +0000 |
| Subject: | note 26209 deleted from function.mktime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56028@lists.php.net to get a copy of this message | ||
Note Submitter: phpnotes@ssilk.de
----
Hmpf, forget this example above! This is well working code, php-mktime() is absolutly bulshit (in my
opinion) - has too many bugs:
// convert sql-like iso-time in number format to unix-timestamp
function sqltime_2_unixtime($str)
{
__if ( preg_match
__('°(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)°',$str,$m) ) {
____return( strtotime("$m[1]-$m[2]-$m[3] $m[4]:$m[5]:$m[6]"));
__}
__return(false);
}