Paul DuBois wrote:
> At 9:27 AM -0300 9/6/01, Amilton Martins wrote:
> >I want to write date type in the format "DD/MM/YYYY" to the database?
> >Can I do this with some parameter to mysql.ini?
>
> No. For storage, you must convert it to CCYY-MM-DD format.
> For display, you can format it to the style you want using
> DATE_FORMAT(d,'%d/%m/%Y').
Besides, dates like DD/MM/YYYY are evil. Remember that Europe uses
DD.MM.YYYY while we crazy americans use MM/DD/YYYY. That can cause lots of
confusion esp. if the day of the month is less than 13.
And, if your dates are of the form YYYY-MM-DD you can use strcmp( ) in C;
eq/lt/gt in perl; or </=/> in PHP to compare dates. That alone is a big
reason to use the YYYY-MM-DD form in my book.
--Bill
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php