cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Filter on Epoch Time

Barbara
New Contributor II

In the flattened data set, $lastUpdatedAt is an Epoch time value (i.e. 1665404233565)

A Filter snap is being used to filter out flattened records updated prior to yesterday. There are 64 records in the dataset that meet that condition.

When the filter expression is set to
$lastUpdatedAt>=Date.parse(Date.now().minusDays(1).toLocaleDateTimeString({โ€œformatโ€:โ€œyyyyMMddโ€}),โ€œyyyyMMddโ€) all records are filtered out.

What filter expression will correctly filter out $lastUpdatedAt Epoch time values greater than zero hundred hours Epoch time yesterday?

1 REPLY 1

bojanvelevski
Valued Contributor

Hi @Barbara,

The reason why all of your records are filtered out is because the expression is trying to compare stringified date value (Date.parse(Date.now().minusDays(1).toLocaleDateTimeString({โ€œformatโ€:โ€œyyyyMMddโ€}),โ€œyyyyMMddโ€)) with epoch time ($lastUpdatedAt)

I would advise you to go with the following expression:

$lastUpdatedAt >= Date.now().minusDays(1).getTime()

Let me know if this helps.

Regards,
Bojan