MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / addHour

Method addHour

src/main/java/com/amazon/ion/Timestamp.java:2554–2558  ·  view source on GitHub ↗

Returns a timestamp relative to this one by the given number of hours. This method always returns a Timestamp with at least MINUTE precision. For example, adding one hour to 2011T results in 2011-01-01T01:00-00:00. To receive a Timestamp that always maintains the same precision a

(int amount)

Source from the content-addressed store, hash-verified

2552 * @param amount a number of hours.
2553 */
2554 public final Timestamp addHour(int amount)
2555 {
2556 long delta = (long) amount * 60 * 60 * 1000;
2557 return addMillisForPrecision(delta, Precision.MINUTE, false);
2558 }
2559
2560 /**
2561 * Returns a timestamp relative to this one by the given number of days.

Calls 1

addMillisForPrecisionMethod · 0.95