Answers for "django.utils.timezone.now()"

0

django import timezone

from django.utils import timezone

now = timezone.now()
Posted by: Guest on March-15-2022
3

how to set indian timezone in django

#Tested it's working modify into settings.py file
TIME_ZONE = 'Asia/Kolkata'
Posted by: Guest on June-21-2021
0

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)
Posted by: Guest on May-06-2022

Python Answers by Framework

Browse Popular Code Answers by Language