[Django]-Django. Get only current day. Only day without time

8👍

You can get the current day from datetime_obj by accessing the day attribute of datetimeobj like datetime.now().day

6👍

In django most of the cases we use timezone. so, it’s recommended to use timezone .

from django.utils import timezone

timezone.now().date()
timezone.now().day

Leave a comment