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
- [Django]-How to solve UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
- [Django]-Why the Simple tag in django is not working?
- [Django]-Displaying pyqtgraph and pyqt widgets on web
- [Django]-Django ignoring translated strings from third party module
- [Django]-DjangoQ run manage.py qcluster results in PermissionError: [WinError5] Access is denied
Source:stackexchange.com