note 12979 deleted from ref.datetime by victor
| From: | victor@php.net | Date: | Mon, 09 Dec 2002 18:50:04 +0000 |
| Subject: | note 12979 deleted from ref.datetime by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40606@lists.php.net to get a copy of this message | ||
This function will return the unix-timestamp of the specified date.
function dateToTime($date, $blnUs = false)
{
$blnUs ? list($m,$d,$y)=split('[.-/,]',$date) :
list($d,$m,$y)=split('[.-/,]',$date);
return mktime(0,0,0,$m,$d,$y);
}
The string containing the date can be of any digit-based format:
d.m.yy, dd/m/yyyy,....
If the 2nd parameter is set to true the function also handles us - formatted dates (m-d-yyyy,
mm.d.yyyy,...)