C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

Difference between two dates in ASP.Net using VB.net


Posted Date: 01 Dec 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: Vijayaragavan.RMember Level: Bronze    
Rating: 1 out of 5Points: 5



The below example demonstrates difference between two dates in ASP.Net using VB.net.

Dim d1 As Date = CDate("2007-12-01")
Dim d2 As Date = CDate("2007-12-11")
Dim t As New TimeSpan
t = d2.Subtract(d1)

Response.Write("Days: " & t.Days & "< br >")
Response.Write("Hours: " & t.Hours & "< br >")
Response.Write("Minutes: " & t.Minutes & " < br >")
Response.Write("Seconds: " & t.Seconds & "< br >")
Response.Write("Total Days: " & t.TotalDays & "< br >")
Response.Write("Total Hours: " & t.TotalHours & "< br >")
Response.Write("Total Minutes: " & t.TotalMinutes & "< br >")
Response.Write("Total Seconds: " & t.TotalSeconds & "< br >")




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Subtract dates  .  Diffrence in dates  .  Difference Between Two Dates in ASP.Net  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: ASP.NET Validation Controls
Previous Resource: Decrypt Function in C# .Net
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use