[RESOLVED] Find the first day of the week?
Hey,
So I can't figure out how to find the first day of the week. I also need it in a format like ("yyyyMMdd")
Right now I only have it telling me its Sunday. I need the exact date.
Code:
Dim FDW As Date
FDW = WeekdayName(1, FirstDayOfWeek.System)
MessageBox.Show(FDW)
Anyone have an idea?
Thanks,
Sean
Re: Find the first day of the week?
Code:
Dim fdw As DateTime = DateTime.Today.AddDays(-Weekday(DateTime.Today, FirstDayOfWeek.System) + 1)
MessageBox.Show(fdw.ToString("yyyyMMdd"))
As you can see I use FirstDayOfWeek.System since in some countries Monday is considered to be the first day of the week and in others its Sunday.
Re: Find the first day of the week?