PC Review


Reply
 
 
Richard
Guest
Posts: n/a
 
      14th May 2004
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


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th May 2004
* "Richard" <(E-Mail Removed)> scripsit:
> 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"))
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
=?Utf-8?B?QW5hbmRbTVZQfQ==?=
Guest
Posts: n/a
 
      14th May 2004
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" wrote:

> 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
>
>
>

 
Reply With Quote
 
=?Utf-8?B?QW5hbmRbTVZQfQ==?=
Guest
Posts: n/a
 
      14th May 2004
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}" wrote:

> 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" wrote:
>
> > 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
> >
> >
> >

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      14th May 2004
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
>
> 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
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th May 2004
Addendum:

>> 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"))
> ///


- or -

'WeekdayName'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:03 AM.