In my settings.py TIME_ZONE is set to 'UTC'.
In one of my models I'm importing the created_on
field from an external API which returns time in utc format. For eg: 1515374422.0
To convert that into DateTime format I use:
created_on=datetime.datetime.fromtimestamp(float(1515374422.0))
post=Post(name="ABC", created_on=created_on)
But that always runs with a RunTime warning of:
RuntimeWarning: DateTimeField Image.added_on received a naive datetime (2017-12-14 14:48:22) while time zone support is active.
I don't understand it. What does that mean? Is something wrong with the DateTime conversion code?