I strongly recommend everyone (regardless of skill) read this very nice article about time and programming/development:
With the TLDR being:
Keep everything simple as much as possible. Even if it means being really inefficient, or redundant, or ugly. Everything adds up, and I think usually programmers overthink time. (Leave overthinking for the times where it’s actually critical to overthink.)
Handle more in the client. This is a little bit of an odd piece of advice, but especially when you have a central service (GraphQL, REST API, some central interface, particularly when hooked up with a single page app, mobile clients, or other clients), I think it’s more important to have as simple a central service as possible. This means it should basically only speak UTC, and might not even handle a lot of the more complicated logic around recurring events, timezones, and so on. It adds redundancy in your clients, but I think it makes it easier to understand overall.
Leverage standards and let others do the heavy lifting. Obviously that means using the Brightest Point in Human History , also known as ISO 8601, but it also means using premade time libraries, resources like the Olson database, and leveraging other people’s existing work as much as possible. Let someone else figure out the really gnarly edge cases so you can work on your domain’s edge cases.
To that end, the entire backend be that the backend application, server, database, whatever all should be set in UTC with no timezones everything needs to talk in UTC and you handle the conversion of time at the client side (who knows it’s own timezone).
Never, ever ever, set a server or database timezone outside of UTC