addHourOfDay()

Adds or subtracts the specified amount of time to the given Hour of Day field, based on the calendar's rules.

Syntax

Calendar addHourOfDay(Numeric amount)
  1. amount is the amount of date or time to be added to the Hour of Day field.

Usage

For example, to subtract 5 hours from the current time of the Hour of Day field, you can achieve it by calling:
addHourOfDay(-5)