Skip to content

Instantly share code, notes, and snippets.

@Gilbishkosma
Last active April 11, 2025 10:56
Show Gist options
  • Save Gilbishkosma/49fd06adf9830ef34a44e889c949c5af to your computer and use it in GitHub Desktop.
Save Gilbishkosma/49fd06adf9830ef34a44e889c949c5af to your computer and use it in GitHub Desktop.
How to handle the datetime for different timezones
-> Store Everything in UTC
-> Select a specific timezone (Asia/Kolkata, Asia/Dubai)
Step1 (Fronted): User enters the datetime (Locale)
Step2 (Backend): Convert it to your desired timezone (Can be used to schedule for a specific timezone) (Optional)
Step3 (Backend): Convert it to UTC
Step4 (Backend): Save it to the DB
Step5 (Frontend): Fetch & convert the UTC time to the locale time of user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment