Working With Date, Timespan and Calender datatypes(ASP.NET)-

With this application, you can know the exact day you were given birth to and also you can calculate the days you have spent on earth living your life.
Create a Project name it "Dateandtime,"  and setting up Default.aspx with the following Server Controls, and programmatic IDs:
  1. birthdayTextBox
  2. daysonEarthButton
  3. birthDay
  4. resultLablel
Default.aspx -Set Up Web Control View:


Default.aspx.cs - CodeBehind:
Under the daysonEarthButton click event 

Default.aspx.cs

Run the program and you will have these results:
1.Click DaysonEarth Button : This calculates and returns the total number of days you have spent on earth.

2.Click BirthDay Button: This shows your birthday either, Sunday, Monday , Tuesday, Wednesday,  Thursday, Friday or Saturday.

Tip:The date here – 09/04/2012 – happens to be my Daughter's birthday, which I know occurred on a Tuesday. You may find it more interesting to input your own birthday to see what day you were born on. 
Good luck.  Follow us and subscribe to more tutorials.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.