monthOfYear Method

Class: Date

Description

This method returns the month of the Date object as a number. Use this method if you need the month part of a date in a numeric context. Use the month method if you need the month part of the date as a String.

Syntax

dateObject.monthOfYear()

Parameters

None

Returns

The month value of a Julian date as a (canonic) Number.

When Became Available

Profile v6.4

Example

type RecordCIF cif = Db.getRecord("CIF","ACN=:ACN")

type Date date = cif.dob              // declare Date object

type Number MONTH = date.monthOfYear()

 

//MONTH is a Number, so numeric compare is safe

if MONTH=7 write "Born in July ..."

 

* Variable ACN must be defined prior to the getRecord statement.