smerny Posted August 16, 2009 Share Posted August 16, 2009 I've been entering my datetime into the database and it's been showing up at -7GMT in the server... I could adjust from there, but i remember seeing something about putting datetime in the database in a certain way... probably setting everything to GMT or something?... what way is it normally done? I've also heard that it might not be best to use datetime in the first place.... what is the best way for keeping track of time (year, month, day, hour, minute, second) in a database? being able to adjust for users with different preferences of timezone. Quote Link to comment https://forums.phpfreaks.com/topic/170471-server-time/ Share on other sites More sharing options...
corbin Posted August 16, 2009 Share Posted August 16, 2009 I believe that DATETIME values are stored as GMT and timezones are factored in only during a SELECT (or something else that displays it).... Could be remembering incorrectly though. As for keeping track of that stuff in a MySQL database, I would use DATETIME. Quote Link to comment https://forums.phpfreaks.com/topic/170471-server-time/#findComment-899269 Share on other sites More sharing options...
fenway Posted August 21, 2009 Share Posted August 21, 2009 Only TIMESTAMP fields "know" about server and session timezones. Quote Link to comment https://forums.phpfreaks.com/topic/170471-server-time/#findComment-903204 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.