Forum Discussion
Thank you @bojanvelevski, should it be > or ‘<’ ?
Now when I reviewed your original post, yes, it should be “<”. You want to consider dates that are less than 10 hours than the current date.
- darshthakkar4 years agoValued Contributor
That’s correct and I can explain you in detail.
Let’s assume, I manually execute this pipeline, the current date and time is June 29, 10:40am EST, with the filter condition, we should only consider records whose Last_updated was before 48hrs than the current date and time.
Let’s assume again that 2 records have Last_Updated as June 27, 6pm EST and the difference is 48hrs (it’s easy to explain if we are considering values (i.e. 24, 48, 72) that are multiple of 24) and the other records have Last_Updated as June 25, 10:40am EST, we should ONLY get those 2 records as those fall into 48hr bracket.
- bojanvelevski4 years agoValued Contributor
Than I go back to my original statement. This expression will do the job:
Date.parse($Last_Updated) > Date.now().minusHours(48)
- darshthakkar4 years agoValued Contributor
I wasn’t able to fetch any records with this criteria but that doesn’t mean this is not the solution. It is indeed and thank you @bojanvelevski for your help on this one.
Reason behind no records to be fetched was there were actually no records those were updated in the last 48 hours, I tweaked my criteria to 7 Days and found some for testing purposes and I can confirm that this worked.
Also, with Date.parse, the date format is consistent so not to worry about EST and UTC.Something new I learned today was
Date.now().minusDays(7)
This above function helped me test the functionality for the last 7 days.
Thanks again @bojanvelevski , signing off from this thread now!
- darshthakkar4 years agoValued Contributor
Moreover, the Timezone of Last_Updated is UTC as I haven’t changed it to any other timezone, may be that is creating a hurdle?