timestamp question ...
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
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);
|All times are GMT +1. The time now is 03:27 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.