Creator Help

addSeconds

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

Description

The addSeconds function returns a date-time value after adding the specified number of seconds. 

Syntax

<date-time>.addSeconds(int)

(or)

addSeconds(date-time, int)

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

The addSeconds function syntax has the following arguments.

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

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

Example

datetime = "Aug 21, 2013 12:30:40";
time = datetime.toTime();


meetingTime=time.ddSecondss(10)       // returns Aug 21, 2013 12:30:50
meetingTime=time.addSeconds(40)       // returns Aug 21, 2013 12:31:20
meetingTime=input.Date_Time.addSeconds(20);  // here, input.Date_Time refers to the date-time field in the form.

datetime = "Aug 21, 2013 12:30:40";
time = datetime.toTime();


meetingTime=addSecondss(time, 10)       // returns Aug 21, 2013 12:30:50
meetingTime=addSeconds(time, 40)       // returns Aug 21, 2013 12:31:20
meetingTime=addSeconds(input.Date_Time, 20);  // here, input.Date_Time refers to the date-time field in the form.

Top