I'm not getting the right time from my datetime field data when trying to fetch the data using fetch API. So here's the data from my database. See image:
Now, my problem is when I'm trying to print the data using console.log
it is giving me a wrong time. See image:
Here's the field in my model:
date_created = models.DateTimeField(auto_now=True, auto_created=True)
Here's my serializer:
class Meta:
model = Message
fields = [ 'date_created',]
Here's also the settings:
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Manila'
USE_I18N = True
USE_L10N = True
USE_TZ = True
I'm not sure where is the problem if it is with the timezone settings? Anyone had an experience of this?