Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created March 11, 2020 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theodesp/8fac9adef166c2bd78df82ed380663d8 to your computer and use it in GitHub Desktop.
Save theodesp/8fac9adef166c2bd78df82ed380663d8 to your computer and use it in GitHub Desktop.
ZonedDateTime example
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