How to test datetime conversion with pytz and tzlocal? How to test datetime conversion with pytz and tzlocal? flask flask

How to test datetime conversion with pytz and tzlocal?


get_localzone() will always return the local timezone of the server your application is running on.

There is nothing in the HTTP headers of the request which can tell you the user's timezone. Instead, the standard way of approaching this is to ask the user to tell you their preferred timezone.

See Determine a User's Timezone for more discussion about this.