How to add Indian Standard Time (IST) in Django?

前端 未结 13 555
终归单人心
终归单人心 2021-02-02 06:22

We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?

相关标签:
13条回答
  • 2021-02-02 07:18

    Adding to Jon Answer, If timezone.now() still not working after changing the TIME_ZONE='Asia/Kolkata'.

    Instead of timezone.now() you can use timezone.localtime().

    Hope it solves.. :)

    0 讨论(0)
提交回复
热议问题