note 110284 added to function.mktime
| From: | AlexK. | Date: | Sun, 07 Oct 2012 21:21:38 +0000 |
| Subject: | note 110284 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191174@lists.php.net to get a copy of this message | ||
HTML5 form output date like 2012-10-08 converted to timestamp.
<?php
/**
* Convert html 5 output like YYYY-MM-DD to timestamp
* @param str $v date
* @return int UNIX timestamp
*
*/
function prepareDate($v) {
$t=explode("-", $v);
return ($v) ? mktime(0,0,0,$t[1],$t[2],$t[0]):false;
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 91.213.119.254
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- https://master.php.net/note/edit/110284
Del: integrated -- https://master.php.net/note/delete/110284/integrated
Del: useless -- https://master.php.net/note/delete/110284/useless
Del: bad code -- https://master.php.net/note/delete/110284/bad+code
Del: spam -- https://master.php.net/note/delete/110284/spam
Del: non-english -- https://master.php.net/note/delete/110284/non-english
Del: in docs -- https://master.php.net/note/delete/110284/in+docs
Del: other reasons-- https://master.php.net/note/delete/110284
Reject -- https://master.php.net/note/reject/110284
Search -- https://master.php.net/manage/user-notes.php