Creator Help

getDay

This topic describes the syntax and usage of the getDay function in Zoho Creator .

Description

The getDay function returns the day of a date, represented by a number. The day is given as an integer ranging from 1 to 31.

Syntax

<datetime>.getDay()

(or)

day(datetime)

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

The getDay function syntax has the following arguments.

datetime - Required. The date of the day 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();
day = x.getDay();   // the variable "day" returns the number 20

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

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

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

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

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

Top