PHP About time and date processing is not very normative, simple, is not know whether the input string can be correctly converted to the desired datetime type.
Object-oriented PHP should use a DateTime class to make string and datetime conversions
From string to TIME type
Datetime::createfromformat (' m/d/y h:i ', ' 03/01/2008 02:20 ');
$totalPrice = 0.0;
from DateTime to String
$datetime = new DateTime (' 2008-08-03 14:52:10 ');
echo $datetime->format (' JS, F Y '). "/n";
Get current time
GETDATE ()
Although this operation is a bit troublesome, but the various parts are their own precise control of the format, the mind is a bit of a better ah.
All of these are for PHP 5.3 only
The old version still needs this.
echo Date (' m/d/y h:i ', Strtotime (' 10/20/2009 15:21 '));
Note: Reading from the database using an array is a character type