Clément Béra | 8310c37 | 2023-01-27 10:31:32 +0100 | [diff] [blame] | 1 | // Copyright (c) 2023, the R8 project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | package newtime; |
| 6 | |
| 7 | import java.time.Clock; |
| 8 | import java.time.LocalDate; |
| 9 | import java.time.LocalTime; |
| 10 | import java.time.OffsetTime; |
| 11 | import java.time.ZoneId; |
| 12 | import java.time.ZoneOffset; |
| 13 | |
| 14 | public class NewTimeMain { |
| 15 | |
| 16 | public static void main(String[] args) { |
| 17 | Clock utc = Clock.tickMillis(ZoneId.of("UTC")); |
| 18 | System.out.println(utc.getZone()); |
| 19 | OffsetTime ot = OffsetTime.of(LocalTime.NOON, ZoneOffset.UTC); |
| 20 | System.out.println(ot.toEpochSecond(LocalDate.MIN)); |
| 21 | } |
| 22 | } |