Can you help to get following values in string format?
Only last sunday date (-7 days from today) from today - Format “dd”
Only the year (-7 days from today) - Format “yyyy”
Only the month ( - 7 days from today) - Format “MMMM”
Can you help to get following values in string format?
Only last sunday date (-7 days from today) from today - Format “dd”
Only the year (-7 days from today) - Format “yyyy”
Only the month ( - 7 days from today) - Format “MMMM”
Now.Adddays(-7).ToString("dd")
Now.Adddays(-7).year
Now.Adddays(-7).ToString("MMMM")
Is this what you need?
or sunday Now.AddDays(Cint(Now.DayOfWeek)*-1).ToString("dd")
cheers
How about this Date expression?
DateTime.Now.AddDays(-7).Year.ToString()
DateTime.Now.AddDays(-7 - (7 + CInt(DateTime.Now.DayOfWeek)) Mod 7).ToString("dd")
DateTime.Now.AddDays(-7).Month.ToString() / DateTime.Now.AddDays(-7).ToString("MMMM")
Regards
Gokul