Hi all,
I need to create a datetime variable that gives me date of monday next week.
For example when i run this, it should give me 16.03.2020.
Thanks,
Hi all,
I need to create a datetime variable that gives me date of monday next week.
For example when i run this, it should give me 16.03.2020.
Thanks,
StringVariable=DateTime.Now.AddDays(+7).AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek.Monday)) mod 7).Date.ToString()
try this
@mazlumkacar
well, if you need the same format you can try this
and let me know if this works
for me it’s working fine!
cheers @mazlumkacar
@mazlumkacar Check this :
now.AddDays((now.DayOfWeek * -1)+8).ToString(“dd.MM.yyyy”)
If this works, Check it tomorrow as well, If it Works Tomorrow, Then it should work Always
hi @supermanPunch how to learn this syntax ?
where can i learn is there any video available or documentaions?
@Jebarohith19 It’s Just Experimenting with trial and error methods . But we need to have basic Knowledge, and that basic knowledge can be found in many tutorials in the web. One Such tutorial I have mentioned below :
Hey there,
sorry to bump this old thread. I’ve tried this solution, and it worked for every day of the week except Sunday. On Sunday, I get dayofweek=0. So (0*-1)+8=8 which gives me the Monday after the one I want.
Am I missing something obvious here?
Best regards,
Jeroen
How to give day(Monday) dynamically
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.