note 72740 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 08 Apr 2007 12:56:54 +0000 |
| Subject: | note 72740 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125201@lists.php.net to get a copy of this message | ||
Note Submitter: erkintek at fotograf dot web dot tr
----
TRstrtotime -- Parse about any Turkish formatted datetime description into a Unix timestamp
function TRstrtotime($date){
if(($date=strptime($date,"%d-%m-%Y %H:%M:%S"))===false)
return false;
return mktime($date['tm_hour'], $date['tm_min'], $date['tm_sec'],
$date['tm_mon']+1, $date['tm_mday'], $date['tm_year']+1900);
}
strptime counts months from 0, where january is first, and of course ends with 11 where december is
12th month. Also (it is neglegable) year is years since 1900, thus we add this part.
I wish we could use format in strtotime, it would make life much easier.