Creator Help

addHour

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

Description

The addHour function returns a date-time value after adding the specified number of hours. 

Syntax

<date-time>.addHour(int)

(or)

addHour(date-time, int)

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

The addHour function syntax has the following arguments.

date-time - Required. The date-time value to which you are adding the specified hours. Date-Time should be a date-time field type or as results of toTime() function.

int - Required.  The number of hours to be added to the date-time value. 

Example

datetime = "Aug 21, 2013 16:04:37";
time = datetime.toTime();

meetingTime=time.addHours(3)       // returns Aug 21, 2013 19:04:37
    

meetingTime=input.Date_Time.addHour(5);  // here, input.Date_Time refers to the date-time field in the form.

datetime = "Aug 21, 2013 16:04:37";
time = datetime.toTime();

meetingTime=addHours(time, 3)       // returns Aug 21, 2013 19:04:37
    

meetingTime=addHour(input.Date_Time, 5);  // here, input.Date_Time refers to the date-time field in the form.

Top