Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Brian Mowbray

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Calculate last day of current Month

'Determines what the next month is based on today and subtracts 1 day from first day of next month.

'VB.NET
Dim NextMonth As Integer
Dim RptYear As Integer
'Determine next month
NextMonth = DatePart(DateInterval.Month, DateAdd(DateInterval.Month, +1, today))
'Determine the year of the next month, in case you are going from Dec to Jan
RptYear = DatePart(DateInterval.Year, DateAdd(DateInterval.Month, +1, today))
'Subtract 1 day from the first day of next month to get this months last day
Return DateAdd(DateInterval.Day, -1, DateValue(NextMonth.ToString & "/1/" & RptYear.ToString))

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS