cancel
Showing results for 
Search instead for 
Did you mean: 

Expression to get Monday of each week

Miya
Level 5
Hi, 
   I am supposed to create the file folders for each week with Monday date, basically bot should check for the current day and create the folder with  this week moday. Please can anyone help to get the expression for this

------------------------------
Miya
------------------------------
1 BEST ANSWER

Helpful Answers

sumire
Level 9

This is the formula for calculating the Monday of a given day. Use code stage.(Language is Visual Basic)
Input argument is "Today", data type is Date.
Output argument is "Monday", data type is Date.
Add "mscorlib.dll" and "System.Runtime.dll" to External References.

Monday = Today.AddDays((Today.DayOfWeek - 1) * -1)



------------------------------
Mitsuko
Asia/Tokyo
------------------------------
------------------------------
Mitsuko
Asia/Tokyo
------------------------------

View answer in original post

3 REPLIES 3

Vikash011
Staff
Staff
Hi Miya,

You can use the expression - FormatDate(Today(), "ddd") .
Get the Todays Day and then you can put a choice stage and subtract the days to get this week Monday.

For Ex: FormatDate(Today(), "ddd")  Result will be Wed

Based on the result you can go to the Wednesday flow and get the date by using expression - AddDays(Today(), -2)

Similarly for rest of the days. If you need Day also please use the FormatDate Expression.

Thanks,
Vikash

------------------------------
Vikash Anand
Senior Software Engineer
Ernst and Young
------------------------------

sumire
Level 9

This is the formula for calculating the Monday of a given day. Use code stage.(Language is Visual Basic)
Input argument is "Today", data type is Date.
Output argument is "Monday", data type is Date.
Add "mscorlib.dll" and "System.Runtime.dll" to External References.

Monday = Today.AddDays((Today.DayOfWeek - 1) * -1)



------------------------------
Mitsuko
Asia/Tokyo
------------------------------
------------------------------
Mitsuko
Asia/Tokyo
------------------------------

Thank You This code was great help

------------------------------
Miya
------------------------------