Should I be storing dates in utc?

Lets say I have a venue booking form that requires start date and end date for an event, users can only book full day events. So should I be storing these dates in utc or local time?
6 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @straightface! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Kyo-chan
Kyo-chan2y ago
It's more complicated than that. The concept of date is not timezoned. One given date doesn't start at the same time everywhere in the world, nor does it end at the same time, but it's still the same date So it would depend on your column type, if it doesn't have a time component, then in principle time zones should not intervene, and if it does anyway, that's more the database engine being nonsensical
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
straightface
straightfaceOP2y ago
thats the thing these are not timestamps, they are dates only so store dates in local time?
Kyo-chan
Kyo-chan2y ago
In principle, you're talking in a context where no time exist but local time, and so therefore it would be more time than local time. It's just a date
JavaBot
JavaBot2y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.
Want results from more Discord servers?
Add your server