VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get information on a month by feeding the function its month number. Returns either month length, l

by Programming Innovations (7 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 19th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get information on a month by feeding the function its month number. Returns either month length, long month name, or short month name.

API Declarations


smpLongMonth = 0
smpShortMonth = 1
smpLength = 2
End Enum

Rate Get information on a month by feeding the function its month number. Returns either month length, l



    Dim dDate As Date
    
    dDate = iMonth & "/1/" & Year(Date)
    
    Select Case tMonthPart
        Case Is = 0 '   Long
            GetMonthInfo = Format(dDate, "MMMM")
        Case Is = 1 '   Short
            GetMonthInfo = UCase(Left(Format(dDate, "MMMM"), 3))
        Case Is = 2 '   Length
            GetMonthInfo = DateSerial(Year(dDate), Month(dDate) + 1, Day(dDate)) - DateSerial(Year(dDate), Month(dDate), Day(dDate))
    End Select
End Function

Download this snippet    Add to My Saved Code

Get information on a month by feeding the function its month number. Returns either month length, l Comments

No comments have been posted about Get information on a month by feeding the function its month number. Returns either month length, l. Why not be the first to post a comment about Get information on a month by feeding the function its month number. Returns either month length, l.

Post your comment

Subject:
Message:
0/1000 characters