Day Name

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi,

Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

Thanks
Richard
 
* "Richard said:
Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

\\\
MsgBox(DateTime.Now.ToString("dddd"))
///
 
And of course you can then pass that enum value to the DateTimeFormatInfo.GetDayName function to get a culture specific description of the Day of week.

--
Regards,
Anand M
VB.NET MVP

http://www.dotnetindia.com


Anand[MVP} said:
DateTime.DayOfWeek?? This will not return Thursday, but rather a enum value for the Day of Week.

--
Regards,
Anand M
VB.NET MVP

http://www.dotnetindia.com


Richard said:
Hi,

Can anyone tell me an easy way to get the name of the day if I supply a
date? For example if I enter the 1/July/2004 I want it to return a
Thrusday. I know there is a function (I think) but I've looked everywhere
and can't find it.

Thanks
Richard
 
Hi Richard,

You can try it this will work for you

MessageBox.Show(CDate("1/July/2004").DayOfWeek.ToString)

However it returns Thursday not Thrusday.

I hope this helps?

Cor
 
Back
Top