note 72739 added to function.strtotime
| From: | erkintek at fotograf dot web dot tr | Date: | Wed, 31 Jan 2007 09:23:20 +0000 |
| Subject: | note 72739 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122402@lists.php.net to get a copy of this message | ||
TRstrtotime -- Parse about any Turkish formatted datetime description into a Unix timestamp
function ($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.
----
Server IP: 139.179.10.17
Probable Submitter: 195.175.46.10
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- https://master.php.net/note/edit/72739
Del: integrated -- https://master.php.net/note/delete/72739/integrated
Del: useless -- https://master.php.net/note/delete/72739/useless
Del: bad code -- https://master.php.net/note/delete/72739/bad+code
Del: spam -- https://master.php.net/note/delete/72739/spam
Del: non-english -- https://master.php.net/note/delete/72739/non-english
Del: in docs -- https://master.php.net/note/delete/72739/in+docs
Del: other reasons-- https://master.php.net/note/delete/72739
Reject -- https://master.php.net/note/reject/72739
Search -- https://master.php.net/manage/user-notes.php