Hello friends, I need help about a topic. I want t...
# orm-help
o
Hello friends, I need help about a topic. I want to find if today is my users birthday. I save the data as DateTime and I want to find them without doing a full for loop to check if day and month are same. How can I make a prisma where query to find those users whose day/month of datetime is equal to the params I will give?
c
Haven't tested this but I'd do something like
Copy code
birthday: {
  gte: new Date().setHours(0, 0, 0, 0),
  lte: new Date().setHours(23, 59, 59, 999),
}
You may also need to call
.toISOString()
on those dates if you're storing them in UTC.