Click here to Skip to main content
16,018,114 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
For example i put 10/09/2013 it give me Wednesday
Posted
Updated 9-Oct-13 2:21am
v2
Comments
Thanks7872 9-Oct-13 8:35am    
See this : day of week vb.net

About 615,000 results in 0.40 seconds
[no name] 9-Oct-13 9:38am    
dt.DayOfWeek
[no name] 9-Oct-13 9:39am    
Mine returned in 0.32 Seconds you are slow

Parse the input date string into DateTime type, and use DayOfWeek property:
string day = DateTime.Parse("10/09/2013").DayOfWeek.ToString();

or if you are taking input in a textbox control then:
string day = DateTime.Parse(TextBox1.Text).DayOfWeek.ToString();

Output: day = Wednesday
 
Share this answer
 
v2
Comments
[no name] 9-Oct-13 9:36am    
My 5 (Y)
Use the .DayOfWeek property

See DateTime.DayOfWeek Property [^]

VB Example
VB
Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek.ToString())
Result:The day of the week for 5/1/2003 is Thursday.


C# Example
C#
Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek);
Result:The day of the week for 5/1/2003 is Thursday.
 
Share this answer
 
v3
Comments
[no name] 9-Oct-13 9:35am    
in VB.net:
dt.DayOfWeek.ToString()
C#
var d=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";

var n = weekday[d.getDay()];


The result of n will be:
Wednesday
 
Share this answer
 
v2
Comments
[no name] 9-Oct-13 9:36am    
Too complex

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900