note 35225 deleted from function.mktime by sniper
| From: | sniper@php.net | Date: | Tue, 04 Nov 2003 13:09:59 +0000 |
| Subject: | note 35225 deleted from function.mktime by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59864@lists.php.net to get a copy of this message | ||
Note Submitter: skipjack
----
this is a function I had to write to pull the date and
time out of a txt file and and convert to a mysql time format
function sqldate($dat)
{
// convert "03/07/11/03:15"
// to mysql DATETIME format "2002-07-23 00:12:56";
$tempdate = split('[/:]', $dat);
$year = $tempdate[0];
$month = $tempdate[1];
$daynum = $tempdate[2];
$hour = $tempdate[3];
$minute = $tempdate[4];
$second = 00;
// mysql DATETIME format :
return\
date("Y-m-dH:i:s",mktime($hour,$minute,$second,\
$month,$daynum,$year));
}