tags:

views:

497

answers:

5

I have a series of dates formatted as:

26/03/1992 12/06/2010 13/01/1995

etc... it's in DD/MM/YYYY. I need to find the day like "Tuesday", "Monday" etc out of them.

I know I need to parse the date or something but I'm unsure how to go about this. thanks.

+3  A: 

You can cast it as a DateTime and use the DayOfWeek property which returns a DayOfWeek enumerator.

Not sure in VB.NET but in C# it's like

DateTime.Now.DayOfWeek or DateTime.Parse(theDateString).DayOfWeek
Fermin
In VB.NET it's... the same ;-)
Meta-Knight
A: 

Have a look at the documentation of the DateTime members Parse, TryParse, DayOfWeek and ToString.

Heinzi
+1  A: 

You want to look at the format strings for the ToString method. MyDate.ToString("dddd") will get you what you want.

PhilPursglove
+1. You can also use VB6-style: `Format$(mydate, "dddd")`
MarkJ
A: 

you could try dateValue.DayOfWeek.ToString()

almog.ori
A: 

Convert the date into a date datatype, then use the format function. This displays monday:

Dim d As Date
d = "11/23/2009"
MsgBox(Format(d, "dddd"))

You could also get a numeric day of the week using d.DayOfWeek.

xpda