Jump to content

Storing Date And Time


smerny

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?

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

I would store them as UNIX timestamps - that way they are very easy to operate on.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...