Help Center
Help Center›FreeBASIC

MonthNamefunction

Gets the name of a month from its integral representation

Date and Time Functionsfunctiondocumented

Syntax

Declare Function MonthName ( ByVal month As Long, ByVal abbreviate As Long = 0 ) As String

Parameters

NameDescription
monththe number of the month of the year - 1:January through 12:December
abbreviateflag to indicate that name should be abbreviated

Return value


Returns the local operating system language month name from month value 1 to 12.

Description


If abbreviate is true, the month name abbreviation is returned. If omitted or false, the whole name is returned.

The compiler will not recognize this function unless vbcompat.bi or datetime.bi is included.

Remarks

Usage


#include "vbcompat.bi"
result = MonthName( month_number [, abreviate ] )

Differences from QB


  • Did not exist in QB. This function appeared in Visual Basic.

See also


Example


#include "vbcompat.bi"



Dim ds As Double = DateSerial(2005, 11, 28) + TimeSerial(7, 30, 50)



Print Format(ds, "yyyy/mm/dd hh:mm:ss "); MonthName(Month(ds))


Reference

  • Documented in KeyPgMonthname.html