note 73466 added to function.mktime
| From: | derrick dot miller dot DONTSENDMEJUNK at axis80 dot com | Date: | Sat, 24 Feb 2007 07:17:32 +0000 |
| Subject: | note 73466 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123798@lists.php.net to get a copy of this message | ||
Here's a handy function which will convert dates in MySQL format (yyyy-mm-dd) to a Unix
timestamp. While this can also be done within MySQL queries via the UNIX_TIMESTAMP() function, it
is not always convenient to do so.
// Returns the Unix timestamp of a MySQL date (YYYY-MM-DD)
function mysqldate_to_unix_timestamp($date) {
list($year, $month, $day) = explode('-', $date);
return mktime(0, 0, 0, $month, $day, $year);
}
----
Server IP: 64.71.164.2
Probable Submitter: 24.89.21.39
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- https://master.php.net/note/edit/73466
Del: integrated -- https://master.php.net/note/delete/73466/integrated
Del: useless -- https://master.php.net/note/delete/73466/useless
Del: bad code -- https://master.php.net/note/delete/73466/bad+code
Del: spam -- https://master.php.net/note/delete/73466/spam
Del: non-english -- https://master.php.net/note/delete/73466/non-english
Del: in docs -- https://master.php.net/note/delete/73466/in+docs
Del: other reasons-- https://master.php.net/note/delete/73466
Reject -- https://master.php.net/note/reject/73466
Search -- https://master.php.net/manage/user-notes.php