Author: Bobby-Z | Posted on: 1/17/2010 9:01:58 PM | Views : 379

 I am having an issue with C# and separating current day, and month into integers. I tried the code in MSDN but it doesn't work.
 
DateTime NowTime = DateTime.Now; int M_Current_Day = NowTime.Day; // Current Date with Day Display int M_Current_Month = Convert.ToInt32(DateTime.Today.Month); //Current Month as a Single Integer Display int CurrentYear = DateTime.Today.Year; // Display Year as Integer Label1.Text = Convert.ToString(M_Current_Month); Label2.Text = Convert.ToString(M_Current_Day); Label3.Text = Convert.ToString(CurrentYear);
 
Labels display nothing, but code shows no errors, and you can see I tried 2 different ways of doing it.
...

Go to the complete details ...