* 이번주 월요일 날짜 구하기 (오늘이 3월 18일 수요일이면, 3월 16일 월요일을 출력함.)

- 참고 주소 : https://forum.uipath.com/t/date-of-monday-in-the-current-week/27309/2

Assign the value as DateTime.Now.AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek .Monday)) mod 7).Date.ToString

 

* 지난주 오늘 요일 날짜 구하기 (오늘이 3월 18일 수요일이면, 3월 11일 수요일을 출력함.)

- 참고 주소 : https://forum.uipath.com/t/get-date-from-last-week/179260

Assign the value as DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")

 

* 지난주 화요일 날짜 구하기 (오늘이 3월 18일 수요일이면, 3월 10일 화요일을 출력함.)

- 참고 주소 : https://forum.uipath.com/t/date-of-monday-in-the-current-week/27309/5

Assign the value as DateTime.Now.AddDays(-7).AddDays(-1*(7 + (DateTime.Now.DayOfWeek - DayOfWeek.Tuesday)) mod 7).ToString("yyyy-MM-dd")
오늘 날짜 - 7 - 1*((7+(오늘요일-구하는요일))을 7로 나눈 나머지 값)

 

* 전월 1일 구하기 (오늘이 9월 17일이면, 8월 1일을 출력함.)

Assign the value as  New DateTime(DateTime.Now.Year, DateTime.Now.Month-1, 1)

 

* 전월 말일 구하기 (오늘이 9월 17일이면, 8월 31일을 출력함.)

Assign the value as  New DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddDays(-1)

 

+ Recent posts