Am trying to fetch data from postgreSQL using sequelize where my current Date is equivelant to the timestamp with the time zone date in the dataBase
const startDate = new Date().setHours(0, 0, 0, 0);
const endDate = new Date().setHours(24,60,60,60)
return await this.accountRepository.findAll({
where: {
'$accountHistory.createdAt$' : { $between: [startDate, endDate] },
},
include: [{
model: AccountHistory,
as: 'accountHistory',
required: false
}],
})
}