datetime.addHours

This function adds the specified number of hours to the mentioned datetime.

Syntax

datetime.addHours(datetime, 0)

Arguments

Argument

Type

Description

datetime

datetime

Date and time to which hours need to be added.

hours

int

Number of hours to be added. The default is 0.

Returns

Type

Description

datetime

Date and time after adding the specified number of hours.

Examples

The function datetime.addHours(datetime.current(), 3) returns the date and time of 3 hours later.