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

前端 未结 13 715
终归单人心
终归单人心 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:15

    All the solutions given above are working.

    see the code i have used to get my timezone. my timezone is Indian standard time zone.

    https://docs.djangoproject.com/en/3.0/topics/i18n/

    LANGUAGE_CODE = 'en-us'
    
    TIME_ZONE =  'Asia/Kolkata'
    
    USE_I18N = True
    
    USE_L10N = True
    
    USE_TZ = True
    

提交回复
热议问题