0

according to this apparently there is no way to read time zone of the end-user in Django. different methods all will read time zone of the server, rather than end user.

I see that in javascript the following code will give time zone of the user and not server:

const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;

according to this which my test confirmed that.

now my question is where would be the cleanest place to run the above code in a Django project which perhaps will be followed by an Ajax call to Activate() timezone.

Nabat Farsi
  • 840
  • 1
  • 9
  • 17

1 Answers1

0

In your template before calling your Ajax function.

jackygab
  • 58
  • 6