Language

ZonedDateTime.PlusHours(Int64) Method

Definition

Returns a copy of this ZonedDateTime with the specified number of hours added.

[Android.Runtime.Register("plusHours", "(J)Ljava/time/ZonedDateTime;", "", ApiSince=26)]
public Java.Time.ZonedDateTime? PlusHours(long hours);
[<Android.Runtime.Register("plusHours", "(J)Ljava/time/ZonedDateTime;", "", ApiSince=26)>]
member this.PlusHours : int64 -> Java.Time.ZonedDateTime

Parameters

hours
Int64

the hours to add, may be negative

Returns

a ZonedDateTime based on this date-time with the hours added, not null

Attributes

Remarks

Returns a copy of this ZonedDateTime with the specified number of hours added. This operates on the instant time-line, such that adding one hour will always be a duration of one hour later. This may cause the local date-time to change by an amount other than one hour. Note that this is a different approach to that used by days, months and years, thus adding one day is not the same as adding 24 hours. For example, consider a time-zone, such as 'Europe/Paris', where the Autumn DST cutover means that the local times 02:00 to 02:59 occur twice changing from offset +02:00 in summer to +01:00 in winter. Adding one hour to 01:30+02:00 will result in 02:30+02:00 (both in summer time); Adding one hour to 02:30+02:00 will result in 02:30+01:00 (moving from summer to winter time); Adding one hour to 02:30+01:00 will result in 03:30+01:00 (both in winter time); Adding three hours to 01:30+02:00 will result in 03:30+01:00 (moving from summer to winter time) This instance is immutable and unaffected by this method call.

Java reference for java.time.ZonedDateTime.plusHours.

Applies to