VB.NET - Cheat sheet for Datediff()



Datediff function caluculate the amount of time between two different dates

'It will return the days between current day and given day 1/1/200

DateDiff("d", Now.Date(), "1/1/2000")  

'It will return months between the given days

DateDiff("m", "1/1/2009","1/1/2000")  

'It will return years between the given days

DateDiff("y", "1/1/2009","1/1/2000")  

'It will return how many weeks are starting from friday between the given days here W is weekday and 6 is value of friday.
DateDiff("w", Now.Date(), "1/1/2001", 6)

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.