I have a model called Data in Django and one of the fields is called time_last_updated. It is initialized as follows:
time_last_updated=timezone.now()
When I query the database (PostgresSQL) manually, the date looks like 2014-02-26 01:42:44.290443+00 which is all fine and as I expected. The problem is that when I take my Data object in a python shell, I get this:
>>> Data.objects.all[0].time_last_updated
datetime.datetime(2014, 2, 26, 1, 42, 44, 290443, tzinfo=<UTC>)
However, if I immediately try and put this result directly back into the shell as if to create a datetime object form it, I get a SyntaxError at the = right after tzinfo.
How is it possible that Django is returning an object with invalid syntax?
datetimeobject.Data.objects.all[0].time_last_updatedis still of adatetimetype.