Skip to content

Instantly share code, notes, and snippets.

@quest4i
Created June 1, 2016 03:16
Show Gist options
  • Save quest4i/d745f1acb6491af341d4e9aa38610503 to your computer and use it in GitHub Desktop.
Save quest4i/d745f1acb6491af341d4e9aa38610503 to your computer and use it in GitHub Desktop.
자바8에서 간단하게 UTC를 가지고 다른 시간대를 표현할 수 있다.
ZonedDateTime utcTime = ZonedDateTime.now(ZoneId.of("UTC"));
System.out.println("협정 세계시 : " + utcTime);
ZonedDateTime seoulTime = utcTime.withZoneSameInstant(ZoneId.of("Asia/Seoul"));
System.out.printf("Seoul : " + seoulTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment