note 72740 added to function.strtotime

From: Date: Wed, 31 Jan 2007 09:23:34 +0000
Subject: note 72740 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-122403@lists.php.net to get a copy of this message
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. ---- 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/72740 Del: integrated -- https://master.php.net/note/delete/72740/integrated Del: useless -- https://master.php.net/note/delete/72740/useless Del: bad code -- https://master.php.net/note/delete/72740/bad+code Del: spam -- https://master.php.net/note/delete/72740/spam Del: non-english -- https://master.php.net/note/delete/72740/non-english Del: in docs -- https://master.php.net/note/delete/72740/in+docs Del: other reasons-- https://master.php.net/note/delete/72740 Reject -- https://master.php.net/note/reject/72740 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122403) next »