note 35225 added to function.mktime
| From: | skipjack at rack1 dot php dot net | Date: | Sun, 24 Aug 2003 09:12:42 +0000 |
| Subject: | note 35225 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-54983@lists.php.net to get a copy of this message | ||
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));
}
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35225
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35225&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35225&report=yes