Re: MySql, PHP, and Dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I originally wrote:

when I retrieve a date from MySQL into PHP, it shows up as a string instead of a date data type

> What's the best way of controlling date format?


John W. Holmes replied:

If you want a Unix timestamp, which is compatible with the date()
function in PHP, then use the UNIX_TIMESTAMP() function in your SQL.

This seems to be the ideal solution. Thanks, John, and also those of you who responded via private e-mail.


I wonder why the PHP/MySql interface doesn't simply return dates as dates instead of strings. *frowns*

Bruce Feist


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux