Jump to content

Incorrect Date: 1969


jadedchron

Recommended Posts

Wednesday, 31st December, 1969 04:00:00 pm is what I'm getting returned from the MySQL database and I'm not sure why. I'm guessing it's based on a Unix timestamp and my PHP function is not formatted properly, but from what I can see from the manual it looks ok. The column type is DateTime.

 

date("l, jS F, Y h:i:s a", $row['date'])

 

Do I need to add specific math in the date function for it to return properly to the current date?

 

Thank you.

 

Link to comment
Share on other sites

Thanks for the replies guys. Not sure why I didn't receive email notifications.

 

echo $raw['date'] gives me "2008-02-26 13:09:47" which is the same as what's in the DB.

 

I'm trying to turn that into a friendlier format such as February 26th, 2008. I wouldn't mind omitting the time to be honest.

 

Any ideas?

 

Thanks,

Nick

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.