Skip to main content
Version: Next

Month of

Month of ( aDate ) : Integer

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

Description

The Month of command returns the month of aDate.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
JanuaryInteger1
FebruaryInteger2
MarchInteger3
AprilInteger4
MayInteger5
JuneInteger6
JulyInteger7
AugustInteger8
SeptemberInteger9
OctoberInteger10
NovemberInteger11
DecemberInteger12

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

Properties

Command number24
Thread safe