View Single Post
Old 11-26-2002, 08:53 AM   PM User | #2
Wichetael
New Coder

 
Join Date: Nov 2002
Location: Netherlands
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Wichetael has a little shameless behaviour in the past
When entering data into your database use time() to get the value you put in the database, that's the standard unix time. ie the number of seconds since unix epoch (January 1 1970 00:00:00 GMT)

Then when you're retrieving the data from your database use date() to convert that timestamp to human readible text. It's documented here.

To get the format you described you'd use:

date('Y-m-d H:i', timestamp);
Wichetael is offline   Reply With Quote