Hey there- Using the below code currently for creating a new folder daily. The code is working but creating the folder with the current business date. How can I work it so it creates the prior business day’s date?
“C:\Users…”+Datetime.today.tostring(“yyyy-MM-dd”)
Thanks!
1 Like
Anil_G
(Anil Gorthi)
June 30, 2023, 3:52pm
2
@dylan.kelly
Please use like this
Path.Combine("C:\Users…",Datetime.today.AddDays(-1).tostring("yyyy-MM-dd"))
Path.Combine will add strings in proper location format
And addDays(-1) will remove 1 day
Cheers
1 Like
ppr
(Peter Preuss)
June 30, 2023, 3:59pm
3
will the bot run on Monday and has to create Friday from the previous week folder?
In such case we could do:
Now.AddDays({-2,-3,-1,-1,-1,-1,-1}(Now.DayOfWeek)).toString("yyyy-MM-dd")
system
(system)
Closed
July 3, 2023, 4:14pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.