Re: datetime

From: Date: Fri, 22 Aug 2003 08:44:14 +0000
Subject: Re: datetime
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-160406@lists.php.net to get a copy of this message
Best and fastest way is to let mysql format the date, look into mysql manual for DATE_FORMAT() function. Dale Hersh wrote:
I am using a mssql database and I have a question regarding the datetime type. When I write a date to the database it store the date in the following format: 6/8/03 But when I extract the date from the database it returns the value in the following format: Jun 8 2003 12:00AM Is there a nice function available in php that will format the date based upon certain specification. I know that date() exists, but I that means I would have to use mktime() which would require parsing the entire string and breaking the string into the day, the month, the year. Furthermore, I would then need a switch statement to convert the value Jun into the value 6. I appreciate any help. Thanks, Dale


« previous php.general (#160406) next »