Hi all,
How can i get the date of Monday in current week?
For Example,
Today date is 29-03-2018.
I want this week Monday date 26-03-2018
Regards,
Abishek
Hi all,
How can i get the date of Monday in current week?
For Example,
Today date is 29-03-2018.
I want this week Monday date 26-03-2018
Regards,
Abishek
In assin activity use this
today = today.now.AddDays(-((now.DayOfWeek - System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek + 6) Mod 7)).Date
Hi @Abishek,
Use this one
strMonday=DateTime.Now.AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek .Monday)) mod 7).Date.ToString()
Regards,
Arivu
Hi @arivu96,
The solution which u gave is working fine. Thank You.
Now i have one more query.
How to get date of last week’s Tuesday?
For Eg: I want Tuesday of lastweek (20-03-2018)
Regards,
Abi
Hi @Abishek,
strTuesday=DateTime.Now.AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek.Tuesday)) mod 7).Date.ToString()
last Tuesday
strTuesday=DateTime.Now.AddDays(-7).AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek.Tuesday)) mod 7).Date.ToString()
Regards,
Arivu
it showing as tuesay is not member of string
how to get next week monday
it is getting current week monday,actually i need next week monday
Thanks a ton for this! Helped me just when required.
How to get next week Monday i.e if today is Monday - 06.07.2020 the next Monday date is 13.07.2020 and likewise if today is Tuesday - 07.07.2020 ,the next Monday date is 13.07.2020
Hi @arivu96
I want to get Date of Sunday of Current week as in my calendar Week Start day is Sunday. What modifications will i have to do in your solution?
Hi @arivu96
I want to get Date of Sunday of current week as my Week starts from Sunday.
What modification will i have to make in this?
Use below code to get Sunday date
Now.AddDAys(-1*Convert.ToInt32((7+(Now.DayOfWeek-DayOfWeek.Sunday)) mod 7)).Date
Regards,
Arivu
Hi @arivu96!
How I can get the date of friday, from a date, for example 14/04/2021 (wednesday)?
With your code I can have the date of monday (12/04/2021), now I would like to have the date of friday (16/04/2021)…
Help me please.
Thanks a lot!
Assign String
strMonday = Now.AddDays(2 - Weekday(Now)).ToString(“dd/MM/yyyy”)
hi sir
i want to pick monday date file every time
can u plz suggest to do that part plz ASAP
thanking u sir
Try Below syntax
List<string> MondaydaysList = directory.GetFiles().Where(x => x.CreationTime.Date == DateTime.Now.AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek.Tuesday)) mod 7).Date)
.Select(x => x.Name)
.ToList();
Regards,
Arivu
can u plz explain in simple way, i am the bigginner of ui path so plz do not mind.
is it works when today id thursday, if i run the bot by taking latest previous monday date ?
DateTime.Now.AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek .Monday)) mod 7).Date.ToString(“MM/dd/yyyy”)
It will give you exact Monday Date no matter which ever day you run the process