Created
March 11, 2020 20:51
-
-
Save theodesp/8fac9adef166c2bd78df82ed380663d8 to your computer and use it in GitHub Desktop.
ZonedDateTime example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thdespou; | |
import java.time.*; | |
public class Main { | |
public static void main(String[] args) { | |
Instant now = Instant.now(); | |
ZonedDateTime zdt = ZonedDateTime.ofInstant(now, | |
ZoneId.systemDefault()); | |
System.out.println( "Date is: " + zdt ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment