Cesar Aracena wrote:

Hi all,

I'm making a site and need some tables from wich I can extract date, time
and/or date/time later with PHP and I neved had very clear the way the
possible formats work with each other so my question is what is the best (or
recommended) method to store dates and/or times in a MySQL DB for PHP to
work later?

Thanks in advanced,
___________________________
Cesar L. Aracena
Commercial Manager / Developer
ICAAM Web Solutions
2K GROUP
Neuquen, Argentina
Tel: +54.299.4774532
Cel: +54.299.6356688
E-mail: [EMAIL PROTECTED]

The best way is to use a datetime or timestamp type in MySql, depending on your use of it. Using MySql's types allows you to use MySql's date comparison and functions for queries. You can get a UNIX timestamp using the UNIX_TIMESTAMP() function in mysql or by using strtotime() in PHP on the value.


--
paperCrane <Justin Patrin>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to