Gary:

Am I looking at PHP's "date()" function? You are taking a timestamp from a MySQL table and wanting to convert it into a US format. Is the timestamp stored in your MySQL table a Unix timestamp or a MySQL timestamp?

It's important to note that you can't take a MySQL timestamp and use PHP's date functions on it, because PHP is expecting a Unix timestamp. You can either, as Daniel suggested, format the date with MySQL's date_format() function, or when selecting the date field in your MySQL query, use MySQL's UNIX_TIMESTAMP() function.

MySQL timestamp format: http://dev.mysql.com/doc/mysql/en/TIMESTAMP_pre-4.1.html
PHP timestamp format: http://us2.php.net/manual/en/function.time.php


Wes


On Jul 5, 2004, at 7:07 PM, Gary Mack wrote:

Hi there,

I am having trouble converting a timestamp from mySQL to the US Format mm/dd/yyyy. Can someone please help. I am also having trouble converting yyyy-mm-dd into a normal mm/dd/yyyy format as well.

I am using the following line of code:

date('m/d/Y', $row10['modified']);

$row10['modified'] is the timestamp from the mySQL database I want to convert from. Thanks in advance.


Gary


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to