RE: [PHP-DB] date
| From: | Rick Emery | Date: | Fri, 26 Oct 2001 13:47:59 +0000 |
| Subject: | RE: [PHP-DB] date | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13750@lists.php.net to get a copy of this message | ||
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