List of usage examples for java.time OffsetDateTime atZoneSameInstant
public ZonedDateTime atZoneSameInstant(ZoneId zone)
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 ww w . j a va 2 s . c o m }
From source file:org.apache.drill.test.TestBuilder.java
/** * Helper method for the timestamp values that depend on the local timezone * @param value expected timestamp value in UTC * @return LocalDateTime value for the local timezone *///from w w w. j a v a2 s .co m public static LocalDateTime convertToLocalDateTime(String value) { OffsetDateTime utcDateTime = LocalDateTime.parse(value, DateUtility.getDateTimeFormatter()) .atOffset(ZoneOffset.UTC); return utcDateTime.atZoneSameInstant(ZoneOffset.systemDefault()).toLocalDateTime(); }