ZoneOffset ofHoursMinutesSeconds(int hours, int minutes, int seconds) example

Description

ZoneOffset ofHoursMinutesSeconds(int hours, int minutes, int seconds) creates an instance of ZoneOffset using an offset in hours, minutes and seconds.

Syntax

ofHoursMinutesSeconds has the following syntax.


public static ZoneOffset ofHoursMinutesSeconds(int hours,     int minutes,     int seconds)

Example

The following example shows how to use ofHoursMinutesSeconds.


import java.time.ZoneOffset;
//w ww.j  av  a  2  s. co  m
public class Main {
  public static void main(String[] args) {
    ZoneOffset t = ZoneOffset.ofHoursMinutesSeconds(1,20,30);
    System.out.println(t);
  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset