Created
October 17, 2018 17:53
-
-
Save erikkaplun/c97aa1e98ab36fafa67a77f96b8cb202 to your computer and use it in GitHub Desktop.
This file contains 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
ZoneId zoneId = null; | |
try { zoneId = ZoneId.of("Europe/Tallinn"); } | |
catch(Exception e) { | |
// what the handler should do when the | |
// provided URL path contains an invalid zone name | |
} | |
// take the current time in the current timezone | |
LocalDateTime localDateTime = LocalDateTime.now(); | |
// "map" it to | |
ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, zoneId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment