Created
August 9, 2017 12:10
-
-
Save mvervuurt/cf720035ecc7af8cf80657c080440c36 to your computer and use it in GitHub Desktop.
TimeDiff based on OffsetDateTime
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
val endDateTimeOffset = endDateTime.getOffset.toString | |
//Create OffsetDateTime in chosen timezone with correct Offset | |
val startDateTime = OffsetDateTime.now(ZoneId.of(endDateTimeOffset)) | |
val timeDiff = ChronoUnit.HOURS.between(startDateTime, endDateTime) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment