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
⌛
This post has been reserved for your question.
Hey @straightface! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
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•2y ago
Message Not Public
Sign In & Join Server To View
thats the thing these are not timestamps, they are dates only
so store dates in local time?
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
💤
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.