Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-24 Thread Richard Lynch
Use the MySQL function that converts timestamp into Unixtime. Or, better yet, use the MySQL function that outputs exactly the date format you want, without dinking around with Unix timestamp in the middle. http://dev.mysql.com/ Search for date_format() I do believe. It's gonna be a whole lot li

RE: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-22 Thread Buesching, Logan J
2:05 AM To: PHP-General Cc: John Taylor-Johnston Subject: [PHP] echo date('Y-m-d', $mydata->timestamp); $mydata->timestamp = "20070419162123"; echo date('Y-m-d', $mydata->timestamp); result: 2038-01-18 ?? What is wrong?? Should be 2007-04-19? -- PHP G

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-22 Thread Jochem Maas
John Taylor-Johnston wrote: > > It is actually a generated timestamp in MySQL. > timestamp(14) > Now what? I was hoping to avoid: > |echo substr(|$mydata->timestamp|, 0, 8); the simplest answer is actually yto make mySQL give you the data in unix timestamp format in the first place: SELECT UNIX_

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-22 Thread Børge Holen
On Sunday 22 April 2007 08:33, John Taylor-Johnston wrote: > It is actually a generated timestamp in MySQL. > timestamp(14) Well, then just use the query to decide how it should look like. Mysql timestamp is amazingly easy to work with. whatevertable,date_format(timestamp_table, 'what should it lo

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-21 Thread John Taylor-Johnston
It is actually a generated timestamp in MySQL. timestamp(14) Now what? I was hoping to avoid: |echo substr(|$mydata->timestamp|, 0, 8); John |Richard Lynch wrote: On Sun, April 22, 2007 1:05 am, John Taylor-Johnston wrote: $mydata->timestamp = "20070419162123"; echo date('Y-m-d', $mydata-

Re: [PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-21 Thread Richard Lynch
On Sun, April 22, 2007 1:05 am, John Taylor-Johnston wrote: > $mydata->timestamp = "20070419162123"; > > echo date('Y-m-d', $mydata->timestamp); > > > result: 2038-01-18 > > ?? What is wrong?? Should be 2007-04-19? date() takes a Unix timestamp as its input. Unix timestamps are measured as number

[PHP] echo date('Y-m-d', $mydata->timestamp);

2007-04-21 Thread John Taylor-Johnston
$mydata->timestamp = "20070419162123"; echo date('Y-m-d', $mydata->timestamp); result: 2038-01-18 ?? What is wrong?? Should be 2007-04-19? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php