Example usage for java.time ZoneId systemDefault

List of usage examples for java.time ZoneId systemDefault

Introduction

In this page you can find the example usage for java.time ZoneId systemDefault.

Prototype

public static ZoneId systemDefault() 

Source Link

Document

Gets the system default time-zone.

Usage

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.parse("2014-12-03T10:15:30.00Z");
    System.out.println(instant.atZone(ZoneId.systemDefault()));

}

From source file:Main.java

public static void main(String[] args) {
    Clock clock = Clock.systemUTC();
    System.out.println(clock.getZone());
    clock.withZone(ZoneId.systemDefault());

    System.out.println(clock.getZone());
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime l = dateTime.withZoneSameLocal(ZoneId.systemDefault());
    System.out.println(l);//from ww  w.j  ava 2s  .  c  o m
}

From source file:Main.java

public static void main(String[] args) {
    Instant instant = Instant.now();
    Clock newClock = Clock.fixed(instant, ZoneId.systemDefault());

    System.out.println(newClock.instant());
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.now();
    ZonedDateTime l = dateTime.withZoneSameInstant(ZoneId.systemDefault());
    System.out.println(l);/*from w  ww .  j a v  a 2  s. c o m*/
}

From source file:Main.java

public static void main(String[] args) {
    ZonedDateTime z = ZonedDateTime.of(LocalDateTime.now(), ZoneId.systemDefault());

    System.out.println(z);//from   www.j a  va2 s .  co m

    LocalDateTime timePoint = LocalDateTime.now();
    ZoneId id = ZoneId.of("Europe/Paris");
    ZonedDateTime zoned = ZonedDateTime.of(timePoint, id);

    System.out.println(zoned);

}

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.now();
    Temporal n = m.adjustInto(OffsetTime.now(ZoneId.systemDefault()));
    System.out.println(n);//from  ww  w. ja va2s .c o m

}

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    ZonedDateTime d = o.atZoneSameInstant(ZoneId.systemDefault());
    System.out.println(d);//from   w  ww.j  a v  a2s. c  o  m
}

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    ZonedDateTime d = o.atZoneSimilarLocal(ZoneId.systemDefault());
    System.out.println(d);// www .  j  a  v a2 s  .  co  m
}

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    long d = o.until(OffsetDateTime.now(ZoneId.systemDefault()), ChronoUnit.WEEKS);
    System.out.println(d);//from  w w w. jav  a  2s . c o m
}