Skip to content

Instantly share code, notes, and snippets.

@NezSpencer
Last active November 8, 2020 10:35
Show Gist options
  • Save NezSpencer/0b1b9eefc0c1d4e5edeebe58f11fe58c to your computer and use it in GitHub Desktop.
Save NezSpencer/0b1b9eefc0c1d4e5edeebe58f11fe58c to your computer and use it in GitHub Desktop.
get the total time deviation(in milliseconds) of the current timezone from GMT
val calendar = Calendar.getInstance()
val utcOffset = calendar.get(Calendar.DST_OFFSET) + calendar.get(Calendar.ZONE_OFFSET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment