Created
October 21, 2020 09:46
-
-
Save nadar71/23e3699705182e56ed40e50838f489cd to your computer and use it in GitHub Desktop.
Return the local time midnight for the provided normalized UTC date.
This file contains hidden or 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
// Return the local time midnight for the provided normalized UTC date. | |
fun getLocalMidnightFromNormalizedUtcDate(normalizedUtcDate: Long): Long { | |
val timeZone = TimeZone.getDefault() | |
val gmtOffset = timeZone.getOffset(normalizedUtcDate).toLong() | |
return normalizedUtcDate - gmtOffset | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment