I don't know, why sequelize changing the dates which I passed in arguments while creating a query?
Database => mysql
I mean that I write following query with sequelize:
Stock.findAll({
where: {
createdAt: {
[Op.between]: ['2021-05-01 00:00:00', '2021-05-27 00:00:00'],
},
},
})
.then((resp) => {
console.log(JSON.parse(JSON.stringify(resp)))
})
.catch((err) => console.error(err))
And sequelize creating this query -
SELECT `id`
, `quantity`
, `event`
, `eventId`
, `createdAt`
, `updatedAt`
, `stockItemId`
FROM `stocks` AS `stocks`
WHERE `stocks`.`createdAt` BETWEEN '2021-04-30 18:30:00' AND '2021-05-26 18:30:00';
Why sequelize changing 2021-05-01 00:00:00 to 2021-04-30 18:30:00 and 2021-05-27 00:00:00 to 2021-05-26 18:30:00?