11-26-2002, 03:40 AM
I am not to sure how to do this ... i have a table with few fields .. and one of them is a TIMESTAMP. How can i display timestamp in proper format YYYY-MM-DD HH:MM ?
I need to display the time / date on the browser
11-26-2002, 09:53 AM
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 (http://www.php.net/manual/en/function.date.php).
To get the format you described you'd use:
date('Y-m-d H:i', timestamp);