Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Usage of DayOfWeek
Message
From
05/05/2014 10:50:35
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
05/05/2014 08:44:30
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01599536
Message ID:
01599548
Views:
42
This message has been marked as a message which has helped to the initial question of the thread.
>I had some code like this:
>
>
>        ' If this is a Sunday
>        If System.DayOfWeek.Sunday Then
>
>
>This did not work. Is this the proper requirement for such usage?
>
>
>        ' If this is a Sunday
>        If Date.Now.DayOfWeek = System.DayOfWeek.Sunday Then
>
I think your first statement is not comparing it to anything, so essentially it's looking to see if System.DayOfWeek.Sunday == true, which it is not, so it will always be false.

Your second code sample should work properly.
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform