Reply to Re: Converting dd/mm/yyyy to YYYY-MM-DD?

Your name:

Reply:


Posted by Michael Fesser on 01/11/07 20:44

..oO(Vincent Delporte)

>On 10 Jan 2007 20:02:21 -0800, "ZeldorBlat" <zeldorblat@gmail.com>
>wrote:
>>I prefer to keep datetime values as timestamps until the last possible
>>moment when I format them for display.
>
>Thanks for the idea, but I still have to display dates as dd/mm/yyyy
>since this is the normal way to display dates over here.

Sure, where's the problem?

>Isn't there a way to configure MySQL to save dates this way, and avoid
>massaging dates between PHP and MySQL?

That's not possible and you don't really want that. Storing dates as
DATE or DATETIME allows the database to do a lot of date calculations
and manipulations. That's why such column types exist.

>That would also make SELECTs
>easier (SELECT * from, instead of having to name all columns just to
>call some date function like UNIX_TIMESTAMP() or DATE_FORMAT() ).

That's how it's supposed to be. Either let the DB return an already
formatted date or a Unix timestamp so PHP can do the rest. Additionally
you should never use SELECT * in a productive application, but list all
fields explicitly.

Micha

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация