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
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."
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.