I am trying to get a DateTimeField element to render appropriately.
Updating the timezone field in my settings.py file allowed me to display the correct time, I did so by simply modifying one field in said file:
TIME_ZONE = 'Europe/Berlin'
But I am using this method in order to format it:
def displayTime(self):
return self.added.strftime('%a %H:%M:%S %d/%m/%y')
The problem is that when I use this method, the time is off by an hour again, as if I never edited the timezone field inside settings.py.
In other words, when I access the time from a template variable modelObject.time
-- the accurate time is displayed, but when I access the time using the method with the strftime method, modelObject.displayTime
the time is off by an hour.