note 76849 added to function.mktime

From: Date: Thu, 02 Aug 2007 03:46:48 +0000
Subject: note 76849 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-129120@lists.php.net to get a copy of this message
As per derrick miller's contribution for MySQL date stamps (which equally applies to pgSQL)... I find this processes a little faster than exploding the string: (All done in one statement) function unix_date($input_date) { // take date string such as "1985-07-25" and return the Unix timestamp return mktime(0, 0, 0, substr($input_date, 5, 2), substr($input_date, 8, 2), substr($input_date, 0,4)); } ---- Server IP: 203.202.10.60 Probable Submitter: 210.1.194.142 ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/76849 Del: integrated -- https://master.php.net/note/delete/76849/integrated Del: useless -- https://master.php.net/note/delete/76849/useless Del: bad code -- https://master.php.net/note/delete/76849/bad+code Del: spam -- https://master.php.net/note/delete/76849/spam Del: non-english -- https://master.php.net/note/delete/76849/non-english Del: in docs -- https://master.php.net/note/delete/76849/in+docs Del: other reasons-- https://master.php.net/note/delete/76849 Reject -- https://master.php.net/note/reject/76849 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#129120) next »