Jump to content

[SOLVED] Problem with date


Cagecrawler

Recommended Posts

I am trying to show a particular date which is stored in my database as a timestamp.  If I echo just the timestamp variable, i get the following:
2007-01-28 04:38:23

However, I put it into the date function like so:
date('j.n H:i',$transactions['time'])

This should display 28.1 23:38, but the timestamp isn't recognised and it displays it as if the timestamp was 0 (ie. 1.1.1970).  How can I get it to use the right timestamp?
Link to comment
https://forums.phpfreaks.com/topic/36030-solved-problem-with-date/
Share on other sites

Are you using mysql? The manual explains this: http://dev.mysql.com/doc/refman/5.0/en/timestamp-4-1.html
"TIMESTAMP columns are displayed in the same format as DATETIME columns. In other words, the display width is fixed at 19 characters, and the format is YYYY-MM-DD HH:MM:SS."

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.