addHours


Adds hours to a specific date/time.

Parameters

Parameter

Data Type

Description

date

Date

The date/time to add the number of hours to.

hours

Number

The number of hours to add to date. The range is from -2400001 to 2400000.

Return Values

Value

Data Type

Description

date

Date

The date/time after adding the number of hours.

Samples

var d = new Date("2021-03-19 02:19:08");
msg = addHours(d,8);
return tools.resultBuilder.build(true, JSON.stringify(msg));


Output

"2021-03-19T10:19:08.000Z"