rfeio Posted October 25, 2007 Share Posted October 25, 2007 Hi! I have a table where one of the fields is a timestamp. I would like to use this field in PHP, and separate the Year, Month and Day into separate variables. For some reason I'm always getting 1970, 01, 01. Can someone help? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/74753-using-a-mysql-timestamp-field-in-php/ Share on other sites More sharing options...
per1os Posted October 25, 2007 Share Posted October 25, 2007 www.php.net/date Take the timestamp and plug it into the date function with the filter you want. If the MySQL Timestamp is setup not in all numbers use www.php.net/strtotime to convert it to a UNIX timestamp, which the date function accepts. Quote Link to comment https://forums.phpfreaks.com/topic/74753-using-a-mysql-timestamp-field-in-php/#findComment-377896 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.