Forum Discussion
amardeep2021
4 years agoNew Contributor III
Thanks Bojan. This works to trim timestamp.
Do you know how to increment the same date in loop till it reaches a specific date field value? Please let me know if you have any tips.
Regards,
Amar.
- bojanvelevski4 years agoValued Contributor
May I ask why do you need the loop when you already know the desired date? If you need all of the dates between two dates with step = 7 ( Ex.: 2022.01.01,…08,…15,…22,2021.01.29), than you can achieve this with the following expression:
sl.range(0,(($endDate-$startDate)/86400000)+1).filter(x=>x%7==0).map(y=>$startDate.plusDays(y))
Here is a sample pipeline as well:
Date Range Step 7_2022_01_20.slp (3.8 KB)
I hope you’ll find this helpful.