RE: [PHP-DB] date
| From: | Rick Emery | Date: | Fri, 26 Oct 2001 14:58:27 +0000 |
| Subject: | RE: [PHP-DB] date | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13753@lists.php.net to get a copy of this message | ||
Yes, PHP is nice. But the more we force MySQL to perform, the less is
required of PHP and the script writer.
-----Original Message-----
From: Steve Cayford [mailto:steve_cayford@unioncab.com]
Sent: Friday, October 26, 2001 9:49 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] date
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
>
--
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