H
H
howuu2019-09-01 21:34:15
Django
howuu, 2019-09-01 21:34:15

How to set Swedish time in Django?

I set it in settings
TIME_ZONE = 'Europe/Stockholm'
but timezone.now() and datetime.now()
save the values ​​​​on my computer (which has a different time zone), how can I fix this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yura Khlyan, 2019-09-02
@MAGistr_MTM

from django.utils import timezone

now = timezone.now()

PS. it googles so fast and easy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question