.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> DateTime >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Function To Get the Difference between 2 Dates in different Formats

Posted By:Prasanti Prusty       Posted Date: December 16, 2009    Points: 10    Category: DateTime    URL: http://www.dotnetspark.com  
 

Function To Get the Difference between 2 Dates in different Formats.

Purpose : Function To Get the Difference between 2 Dates .
In the Form of : Day ,DayOfYear ,Hour,Minute,Month,Quarter Second,Weekday,WeekOfYear,Year
' Use : DateInterval.Day / DateInterval.DayOfYear ....

Public Sub DateDifference()
    Dim DateDiffVal As Long
    DateDiffVal = DateDiff(DateInterval.Year, DateTimePicker1.Value, DateTimePicker2.Value)
    MsgBox("Date Difference Is : " & DateDiffVal, MsgBoxStyle.DefaultButton1, "Information")
End Sub

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend