ZoneOffset getTotalSeconds() example

Description

ZoneOffset getTotalSeconds() gets the total zone offset in seconds.

Syntax

getTotalSeconds has the following syntax.


public int getTotalSeconds()

Example

The following example shows how to use getTotalSeconds.


import java.time.ZoneOffset;
/* www . ja v a  2 s  . c o  m*/
public class Main {
  public static void main(String[] args) {
    ZoneOffset z = ZoneOffset.UTC;
    int t = z.getTotalSeconds();
    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