0

I am building a application where the clients are supposed to pass a datetime field to query the database. But the client will be in different timezones, so how to solve that problem. Should I make it a point that the client's timezone is used as deafult for each user or the server for every user. And if so than how can I do it?

Saransh Mohapatra
  • 9,430
  • 10
  • 39
  • 50

2 Answers2

1

generally, the server is setup to run as UTC, which has no daylight saving time, etc, and each user's settings contains their preferred timezone. Then you do the time difference calculation. You DB might have that feature.

Christopher Mahan
  • 7,621
  • 9
  • 53
  • 66
0

Just use the django timezone feature to get the timezone of the user and to convert it to your local timezone for the db-query.

Thomas Schwärzl
  • 9,518
  • 6
  • 43
  • 69