Jump to content

Storing Date And Time


smerny
 Share

Recommended Posts

It seems like i've seen a few different ways to keep track of date/time... I am currently using the datetime field type of mysql and updating it with NOW(), although I'm thinking maybe I should have used UTC_timestamp?I'm just looking for whichever is most practical, efficient, and accurate for storing times for messages and posts and logs and such and being able to find the differences in time between two times or one time and the current time.... and make the time fit for the users timezone preferenceany thoughts/ideas?

Edited by smerny
Link to comment
Share on other sites

My personal solution to using timezones was to let the user set their timezone in the control panel for their account and then store the current date and time based on the server time and adjust the value by the timezone the user had set in their account. This allowed for greater control over managing users based on the users timezones.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...