If you need to get the last day in a month in VBScript you can use the following function.

Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
' @Author - Alexander Bolte
' @ChnageDate - 2015-03-11
' @Description - Returns a Date representing the last day of a given month.
' @Param monthNumber - a 1 based Integer representing a month.
' @Returns a Date representing the last day of a given month.
Function getLastDayInMonth(monthNumber) ' As Date
	Dim lastDay ' As Date
 
	lastDay = Now()
	lastDay = DateSerial(year(lastDay), monthNumber + 1, 0)
 
	getLastDayInMonth = lastDay
End Function

 

References

I found this little trick on a Microsoft page, which also describes how to calculate several dates depending on the current date.

https://msdn.microsoft.com/en-us/library/aa227533(v=vs.60).aspx