3
Answers

Get no of months.....

Ask a question
I have a question people..plz help me...here are the code lines.....

 public partial class Form1 : Form
   {
       public DateTime today = System.DateTime.Today;
       public DateTime FinalDayOfPayment= Convert.ToDateTime("1/12/2011");
       public TimeSpan noOfDays;




       public Form1()
       {
           InitializeComponent();
       }


       private void Form1_Load(object sender, EventArgs e)
       {
           label1.Text = today.ToString();
           label2.Text = FinalDayOfPayment.ToString();


           noOfDays = today - FinalDayOfPayment;


           label3.Text = noOfDays.ToString();
           
       }
   }

This gives me the no of days...but a want to get the no of months..
Is there any other way to get it..???

Answers (3)