SnapWizard
3 years agoNew Contributor III
Create a file path with a date in File Writer snap
I have a pipeline that generates an output file that I would like to save in S3 with a file path of
YYYY/MM/dd/file_name… e.g. S3://bucket/2023/08/09/file_name.csv. When I do this:
“s3:///bucket/”+Date.now().getFullYear()+“/”+Date.now().getMonth()+“/”+Date.now().getDate()+“/fil_name.csv”
It generates a path of 2023/8/9, How can I programmatically determine when to pad it with a ‘0’ for single digit months and days without including this data in the document being saved?