How do I query all records based on a day/month/year condition from a timestamp??

I need some help with timestamp filters in Xano for a conditional query all records.

I have two variables - one is “today” - which is a timestamp set when the function is run.

I also have “dayOffset” - which is an integer value of 0-30 - set to 0 by default and will be increased +1 through a For Loop that runs 30 times.

Inside the For Loop - I am querying all records for a user filtered by a timestamp (“last_activity”) of their last activity.

SPECIFIC QUESTION: I want to add a condition in this querying all records filter that checks if that “last_activity” timestamp occurred on the day that is equal to the date of “today” - “dayOffset”.

example: if dayOffset = 1, then I am checking if the “last_activity” happened yesterday (1 day BEFORE today).

UPDATE: I’ve been trying some things with various timestamp filters - but my issue is that I want filter the “get all records” with condition of user_id AND condition “last_activity” happened ANYTIME on the date (“today” - “dayOffset) - and since the timestamp filters are different for variables and queries - I’m not sure how to ignore hours/minutes/milliseconds in the “==” condition?

Is there a filter / formula that would take the unix timestamp and ROUND IT to day + month + year without any hours/minutes/milliseconds? If I could do that I could apply to both “last_activity” timestamp and “today” to normalize them and then do a “==” condition??

10 replies