Hmm.

Is there a way to get the day name (ie Monday) given a year, month and
day number?

Thanks,

Chris

Re: Get day name given year, month and day number by Jon

Jon
Thu Aug 24 16:09:27 CDT 2006

You could do something like.

create your date

DateTime date = DateTime.Parse("08/24/2006");

string dateString = date.ToLongDateString();

dateString will contain the day name and you should be able to parse it out
of there.

-Jon


"Stupid48" <cf_rich@hotmail.com> wrote in message
news:1156448859.077153.145110@m73g2000cwd.googlegroups.com...
> Hmm.
>
> Is there a way to get the day name (ie Monday) given a year, month and
> day number?
>
> Thanks,
>
> Chris
>



Re: Get day name given year, month and day number by Carl

Carl
Thu Aug 24 21:06:38 CDT 2006

Stupid48 wrote:
> Hmm.
>
> Is there a way to get the day name (ie Monday) given a year, month and
> day number?

using System;
using System.Globalization;

// ...

DateTime dt = new DateTime(year,month.day);

DayOfWeek dow = dt.DayOfWeek; // DayOfWeek is an enum

// To get the localized day name...
DateTimeFormatInfo dfi = CultureInfo.CurrentCulture;
string dayName = dfi.DayNames[dow];


-cd