In-line handlebar variables for min date in the correct timezone format
Hi all, I'm in the process of creating a custom export to CSV from a connector and need to export a specific date range (basically anything from yesterday in my local timezone).
How do I nest an in-line handlebar expression for min date in the correct timezone format to facilitate this?
I can see dateFormat and dateAdd though do I combine the two together?
I know it's probably a fairly simple one, though often the getting the formatting of these things right and functional, especially with times, is very time consuming and I need a fast answer, with one not readily apparent in the Celigo handlebar formatting guide (would be good to include some examples of this in the date formattings as I'm sure it's been a very common question over time).
Regards,
Christian
Comments
If you want to use dateAdd, check this comment by Stephen Brandt on how to nest them together.

moving this post to the Troubleshoot custom flows section for better visibility for all users who may have this same question.
If you use Delta Export Type and schedule the flow to run every day Celigo will take care of the calculation and formatting for you :-)
Sachin Goud Godishela that was of great assistance to get close to the formatting needed, so thankyou for that.
I additionally needed the timezone included, so the expression ended up being as follows.
Yesterday (created_at_min)
{{dateFormat 'YYYY-MM-DD hh:mmZ' (dateAdd (timestamp) '-86400000') 'YYYY-MM-DD hh:mm' 'Australia/Melbourne' }}
The day before yesterday (created_at_max)
{{dateFormat 'YYYY-MM-DD hh:mmZ' (dateAdd (timestamp) '-86400000') 'YYYY-MM-DD hh:mm' 'Australia/Melbourne' }}
End result:
Anyway, it will be helpful for anyone ever needing to create reports between a 24-hour period range.
Thankyou for your assistance.
Regards,
Christian
Thank you for sharing this information Christian Bannard. This truly will be helpful for other users.
Please sign in to leave a comment.