Tutorials Forums
     Tutorials Videos
        Sign Up Now For FREE
Welcome, Guest
Username Password: Remember me

Get Date for last day in Month
(1 viewing) (1) Guest
VB.NET HELP, VB.NET TUTORIALS, VB.NET CODE, VB.NET PROGRAMMING, VB.NET

Visual Basic.NET is the most recent generation of Visual Basic. Developers will be pleased to note that its new features include inheritance, method overloading, structured exception handling, and more. These capabilities make it easier than ever to create .NET applications, including Windows applications, web services, and web applications. The articles in this section give you all the tips you need to work wit this useful language.
  • Page:
  • 1

TOPIC: Get Date for last day in Month

Get Date for last day in Month 09 Dec 2009 15:40 #75

Get the last day in the month, where the month is in the date you supply.


 
GetLastDayInMonthDate("#2009-02-20#")
 
Function GetLastDayInMonth(ByVal dtDate As Date) As Date
 
'example for #2009-02-20# we want to get the last day in the month 02,
'
(ie. date for last day in Feb)
 
Return DateAdd(DateInterval.Day, _
(Day(DateAdd(DateInterval.Month, 1, dtDate))) * -1, _
DateAdd(DateInterval.Month, 1, dtDate))
 
End Function
 
  • CE
  • OFFLINE
  • Administrator
  • Posts: 197
  • Karma: 78
CodersEngine
  • Page:
  • 1
Time to create page: 0.27 seconds