Created
July 29, 2015 19:21
-
-
Save liry/701adafca6c6c3776aa7 to your computer and use it in GitHub Desktop.
Convert Java 8 ZonedDateTime to DateTime (joda-time).
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
static DateTime zonedDateTimeToDateTime(final ZonedDateTime zdt) { | |
return new DateTime(zdt.toInstant().toEpochMilli(), DateTimeZone.forID(zdt.getOffset().getId())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment