Hi All,
I want to find out Third Friday of the specific month. Can anyone help me in resolving this please?
Hi All,
I want to find out Third Friday of the specific month. Can anyone help me in resolving this please?
Hi
You can use this expression in a assign activity like this
Str_date = DateTime.Today.AddDays((18 - DateTime.Today.DayOfWeek + 7) Mod 7).ToString
If you want as a Datetime type itself then don’t put .ToString
Cheers @Aswini
I tried using this but its giving me 27th of this month. But I want 21st as the result
Find the first Friday of the month (it’s one of the days between 1th and 7th). Then add 14 to get the 3rd Friday.
Try modifying the same expression like this
New DateTime(year, month, 1).AddDays((18 - CInt(New DateTime(year, month, 1).DayOfWeek)) Mod 7 + 14)
Cheers @Aswini
Unfortunately the above expression giving me error.
Fine can u share the screenshot of the erro
Lets assume a variable CheckDate representing a DateTime (e.g. Today)
check with another Date:
Enumerable.Range(1,DateTime.DaysInMonth(CheckDate.Year, CheckDate.Month)).Select(Function (x) new DateTime(CheckDate.Year, CheckDate.Month,x)).Where(Function (x) x.DayOfWeek = 5)(2)
Depending on some constraints we can also modify and maybe compacting the statement
Its working. Thank you @pp
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.