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.
Go to the Number tab in the Format Cells dialog box. Select Custom as the Category. Add dddd into the Type field for the full weekday name or ddd for the abbreviated weekday name. Press the OK button.
The WEEKDAY Function[1] is an Excel DATE and TIME Function. The function will return an integer that is a representation of the day of the week for a given date.
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
You want to look at the format strings for the ToString method. MyDate.ToString("dddd")
will get you what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With