Hi guys, how can i get entries that is one month o...
# orm-help
h
Hi guys, how can i get entries that is one month old in Prisma? I am struggling with the Datetime, What i have done so far:
Copy code
const date = new Date();
const numberOfDays = 30; 
const month = date.setDate(date.getDate() - numberOfDays); 

const items = await prisma.items.findMany({ where: { createdAt: { gt: month } } });
But i get an error that says:
Argument createdAt: Got invalid value on prisma.aggregateProduct. Provided Json, expected DateTimeFilter or DateTime.
How can i query by datetime?