30đź‘Ť
âś…
Try %d/%b/%Y:%H:%M:%S
instead – %y
right now means 11.
You can “debug” datetime formats easily using date
(on the shell and not on python, I mean, assuming you’re running GNU/Linux or similar):
date '+%d/%b/%Y:%H:%M:%S'
05/May/2011:09:00:41
👤Eduardo Ivanec
12đź‘Ť
You’re checking for a 2 digit year ( %y ) instead of a four digit ( %Y )
👤Riccardo Galli
- Moving from direct_to_template to new TemplateView in Django
- Can't pip install mysql-python
- Django – How to send a success message using a UpdateView CBV
- How to have a nested inline formset within a form in Django?
6đź‘Ť
You want %Y instead of %y. %Y means you want the century, %y is no century and the year is displayed from 00 to 99.
👤rtn
- Efficient function to retrieve a queryset of ancestors of an mptt queryset
- How to downgrade from Django 1.7 to Django 1.6
- Generate unique hashes for django models
- How to display "This many months ago" in Django using Humanize?
- Can't Create Super User Django
Source:stackexchange.com