MYSQL return date column not match


#1

Hi,
My table “users” have column “date_of_birth” type DATE.
Value is “1993-12-26”.
But auth return user is “1993-12-25T17:00:00.000Z”.
I don’t know why?
mysql


#2

https://adonisjs.com/docs/4.0/lucid#_casting_dates


#4

maybe you need use a sql function like this

const data  = Model.query()
              .select(Database.raw("DATE_FORMAT(created_at, '%Y-%m-%d %h:%i:%S') as Date"))
              .fetch()

with this sql function you can indicate in an expressive way wich date format do you need, omitting extra info; because OOZ means datetime zone; so with this code you can show only data in this format: 2018-10-12 12:15:01