G
greyseal
Consider the following:
As I post this, it is June 11th, 2004.
My desk calendar tells me it is day 163 of the current year.
This code:
Calendar myCal = CultureInfo.InvariantCulture.Calendar;
DateTime theDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month,
DateTime.Now.Day, new GregorianCalendar() );
string dateBack = theDate.ToString("D") + " (" +
myCal.GetDayOfYear(theDate).ToString() + ")";
returns Friday, June 11, 2004 (150)
Obviously, the day of the year is incorrect. What am I doing wrong?
TIA.
greyseal
As I post this, it is June 11th, 2004.
My desk calendar tells me it is day 163 of the current year.
This code:
Calendar myCal = CultureInfo.InvariantCulture.Calendar;
DateTime theDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month,
DateTime.Now.Day, new GregorianCalendar() );
string dateBack = theDate.ToString("D") + " (" +
myCal.GetDayOfYear(theDate).ToString() + ")";
returns Friday, June 11, 2004 (150)
Obviously, the day of the year is incorrect. What am I doing wrong?
TIA.
greyseal