Skip to main content
Version: 20 R7 BETA

Month of

Month of ( aDate ) -> Function result

ParameterTypeDescription
aDateDateDate for which to return the month
Function resultLongintNumber indicating the month of date

Description

The Month of command returns the month of aDate.

Note: Month of returns the number of the month, not the name (see Example 1).

To compare the value returned by this function, 4D provides the following predefined constants, found in the "Days and Months" theme:

ConstantTypeValue
JanuaryLongint1
FebruaryLongint2
MarchLongint3
AprilLongint4
MayLongint5
JuneLongint6
JulyLongint7
AugustLongint8
SeptemberLongint9
OctoberLongint10
NovemberLongint11
DecemberLongint12

Example 1

The following example illustrates the use of Month of. The results are assigned to the variable vResult. The comments describe what is put in vResult:

 vResult:=Month of(!12/25/92!) // vResult gets 12
 vResult:=Month of(Current date) // vResult gets month of current date

Example 2

See example for the Current date command.

See also

Day of
Year of