django import timezone
from django.utils import timezone
now = timezone.now()
django import timezone
from django.utils import timezone
now = timezone.now()
how to set indian timezone in django
#Tested it's working modify into settings.py file
TIME_ZONE = 'Asia/Kolkata'
django timezone settings
Here is the list of valid timezones:
http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
You can use
TIME_ZONE = 'Europe/Istanbul'
for UTC+02:00
The datetime and django.utils.timezone modules are available, so you can do e.g. timezone.now
# define default value like this.
bilal_dev = models.ImageField(upload_to='abc/', default=datetime.now)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us