>From docs: "...there’s no equivalent of the Accept-Language HTTP header
that Django could use to determine the user’s time zone automatically.
Instead, Django provides time zone selection functions
<https://docs.djangoproject.com/en/dev/ref/utils/#time-zone-selection-functions>.
Use them to build the time zone selection logic that makes sense for you."

There is two paths.
First. You can store time on the server in UTC, detect user timezone and
then do conversion to this timezone on your backend. You can also look at
https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#localtime
Second path is that you can do time conversion on the frontend using
whatever you like JS library to do this work. But in both cases you should
determine users timezone yourself or ask user in which TZ he is.

сб, 8 дек. 2018 г. в 07:02, <thanh.nguyenba0...@gmail.com>:

> Hello,
> I think you can use "request.META" django. (request.META['TZ']). It is
> timezone user submit request.
>
> :D
>
> On Saturday, December 8, 2018 at 8:39:29 AM UTC+7, Deniz Bazan wrote:
>>
>> Hello everybody,
>> I have a django web app, in my app i want to show in the page where the
>> time information is, with user timezone.
>>
>> I have a form with start_time and end_time(Timefield) user send this with
>> a specific timezone(Berlin/Europa) after this when a user go to the page,
>> the user should see the page with his own timezone.
>>
>> I use Django 2.1 with postgresql database.
>>
>> Thanks for any recommendation!
>> Regards,
>> Deniz
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/eaa47d65-8bd5-4a9d-95a4-28bc5761317c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/eaa47d65-8bd5-4a9d-95a4-28bc5761317c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
*Vovk Donets*
 python developer

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPTMM-wAYdM2q%3DdQjaBZNvdbBX6DANkHYSqaW4%3DDambBN9WeaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to