note 87078 modified in function.strtotime by danbrown
| From: | danbrown@php.net | Date: | Tue, 18 Nov 2008 21:25:50 +0000 |
| Subject: | note 87078 modified in function.strtotime by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146665@lists.php.net to get a copy of this message | ||
<?php
/**
* strToTime wrapper
*
* @bool bool|int - returns false for '0000-00-00' and '0000-00-00 00:00:00'
*/
function myStrToTime(string $time, int $now = null)
{
if('0000-00-00' == $time || '0000-00-00 00:00:00' == $time) {
return false;
}
//In version 5.2.6 strToTime returns int(-62169966000) for the 0 dates above
return strToTime($time, $now);
}
?>
--was--
/**
* strToTime wrapper
*
* @bool bool|int - returns false for '0000-00-00' and '0000-00-00 00:00:00'
*/
function myStrToTime(string $time, int $now = null)
{
if('0000-00-00' == $time || '0000-00-00 00:00:00' == $time) {
return false;
}
//In version 5.2.6 strToTime returns int(-62169966000) for the 0 dates above
return strToTime($time, $now);
}
http://php.net/manual/en/function.strtotime.php