note 72739 deleted from function.strtotime by nlopess

From: Date: Wed, 31 Jan 2007 13:25:39 +0000
Subject: note 72739 deleted from function.strtotime by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-122420@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 ($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.

« previous php.notes (#122420) next »