Note Submitter: erkintek at fotograf dot web dot tr
----
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.
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|