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

前端 未结 13 588
终归单人心
终归单人心 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 06:54

    Keep TIME_ZONE = 'Asia/Kolkata' in settings.py file and restart the service from where you are accessing the timezone (server or shell). In my case, I restarted the python shell in which I was working and it worked fine for me.

提交回复
热议问题