cooperino's avatar

Change time zone/format from a single selection source

If my project has timestamps in many places, what would be a good design to be able to let the user select his preference (zone, format) from a single place, such as a dropdown

0 likes
1 reply
Braunson's avatar

Generally it's best to store all datetimes in UTC then let the user set their Timezone (sure in a dropdown in say a profile or settings page available to the user), store it on their User model and then translate the dates to their timezone on the fly. This way all datetimes are stored in one single timezone that you can convert as needed.

Please or to participate in this conversation.