Bdate
I want to gate diffrence of current date and birth date. Mens output like 24 years 2 hours 35 minute 2 second. Check above in each second.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Hiren SoniRank #694 · 3.5K reputationPosted Jan 24, 2010, 4:37 PM EST
{
Timer T1 = new Timer();
T1.Start();
InitializeComponent();
T1.Tick += new EventHandler(display);
}
private void display(object sender, System.EventArgs e)
{
// THIS CODE DISPLAY DIFFERENCE B'WIN BIRTHDATE AND CURRENT DATE
// AND TIMING ALSO
DateTime startDate = Convert.ToDateTime("01/01/1989 3:30:00 PM");
DateTime endDate = DateTime.Now;
TimeSpan ts = endDate.Subtract(startDate);
// DISPLAY VALUES TO THE TEXTBOXES...
txtDifference.Text = ts.ToString();
txtDays.Text = ts.Days.ToString();
txtHours.Text = ts.Hours.ToString();
txtMinutes.Text = ts.Minutes.ToString();
txtSeconds.Text = ts.Seconds.ToString();
txtMilliseconds.Text = ts.Milliseconds.ToString();
}