Calculate Date time difference in asp.net c#
TimeSpan tmspan = DateTime.Parse(DateTime.Now.ToString()).Subtract(DateTime.Parse(YourTime.Text));
Response.Write(tmspan.Hours);
Response.Write("<br>"); Response.Write(tmspan.Minutes); Response.Write("<br>"); Response.Write(tmspan.TotalHours); Response.Write("<br>"); Response.Write(tmspan.TotalMinutes);
No comments:
Post a Comment