Month of

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


Month of (date) Number

ParameterTypeDescription
dateDateDate for which to return the month
Function resultNumberNumber indicating the month of date

Description

The Month of command returns the month of date.

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

4th Dimension provides the following predefined constants:

ConstantTypeValue
JanuaryLong Integer 1
FebruaryLong Integer 2
MarchLong Integer 3
AprilLong Integer 4
MayLong Integer 5
JuneLong Integer 6
JulyLong Integer 7
AugustLong Integer 8
SeptemberLong Integer 9
OctoberLong Integer10
NovemberLong Integer11
DecemberLong Integer12

Examples

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

2. See example for the command Current date.

3. 4th Dimension's 'STR#' ID=11 resource includes the names of the months localized for the current country:

The following project method returns the name of the month for a date:

      ` Month name of project method
      ` Month name of ( Date ) -> String
      ` Month name of ( Date ) -> Name of the month

   $0:=Get indexed string(11;12+Month of ($1))

The following project method returns the abbreviation of the month for a date:

      ` Month abbr of project method
      ` Month abbr of ( Date ) -> String
      ` Month abbr of ( Date ) -> Name of the month

   $0:=Get indexed string(11;Month of ($1))

See Also

Day of, Year of.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next