Thursday, September 24, 2009

VBScript - Get Previous / Next Month Names

Function NextMonthName(dateval)
    Dim tmp : tmp = DateAdd("m", 1, dateval)
    NextMonthName = MonthName(Month(tmp))
End Function


Function PrevMonthName(dateval)
    Dim tmp : tmp = DateAdd("m", -1, dateval)
    PrevMonthName = MonthName(Month(tmp))
End Function

No comments:

Post a Comment