Creator Help

getMonth

This topic describes the syntax and usage of the getMonthDescription

Description

The getMonth function returns the month of a date represented by a number. The month is given as an integer, ranging from 1 (January) to 12 (December).

Syntax

<datetime>.getMonth()

(or)

MONTH(datetime)

// this format is supported only in the free flow scripting mode of Script builder.

The getMonth function syntax has the following arguments.

datetime - Required. The date of the month you are trying to find. This can be a date or date-time field, the "today" variable which returns the current day, or results of other date functions, for example, toDate()

Example

a. In this example, the date format specified in the application settings page is dd-MMM-yyyy. Hence the date text "05-20-13" is converted to date format as 20-May-2013. 

str = "05-20-13";
x = str.toDate();
month = x.getMonth();   // The month variable returns the number 5

mont=input.Sale_Date.getMonth();   // Here, the form field "Sale_Date" is used as input to the getDay function.

month=today.getMonth();    //Here, the zoho variable "today" is used as input to the day function.

str = "05-20-13";
x = dateValue(str);
month = month(x);   // the variable "month" returns the number 20

month=month(input.Sale_Date);   // Here, the form field is used as input to the month function.

mont=month(today);   // Here, the zoho variable "today" is used as input to the month function.

Top