|
-
Jan 21st, 2010, 10:39 AM
#1
Thread Starter
Lively Member
[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
-
Jan 21st, 2010, 10:52 AM
#2
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.
-
Jan 21st, 2010, 10:55 AM
#3
Thread Starter
Lively Member
Re: Find the first day of the week?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|