Re: date

From: Date: Fri, 26 Oct 2001 14:48:47 +0000
Subject: Re: date
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-13752@lists.php.net to get a copy of this message
Check out the date functions in php, they're very nice. mktime(), date(), strftime(), and setlocale() -Steve On Friday, October 26, 2001, at 08:47 AM, Rick Emery wrote:
Assume the following table: create mytable ( mydate date ); Assume the following inserts: INSERT INTO mytable VALUES( "2003-02-20"); INSERT INTO mytable VALUES( "2004-12-25"); INSERT INTO mytable VALUES( "1999-01-01"); The following will order this table, assuming precedence of year->month->day, and print in Euro format: SELECT DATE_FORMAT(mydate,"%d/%m/%Y") FROM mytable ORDER BY mydate; The following will order this table, assuming precedence of day->month->year, and print in Euro format: SELECT DATE_FORMAT(mydate,"%d/%m/%Y") AS edate FROM mytable ORDER BY edate; With basic PHP, you can format the Euro date input into the script into the YYYY-MM-DD requied for insertion into the database. -----Original Message----- From: ax [mailto:aznym@crosswinds.net] Sent: Friday, October 26, 2001 6:11 AM To: php-db@lists.php.net Subject: [PHP-DB] date how would i enter european format date into mysql (dd/mm/yyyy) ... and how would i make the query sort by date if i am using this format ?? ax -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.db (#13752) next »