Skip to content

Instantly share code, notes, and snippets.

@thesmart
Created October 14, 2014 22:29
Show Gist options
  • Save thesmart/bb8de57f9a1bd6d40b8f to your computer and use it in GitHub Desktop.
Save thesmart/bb8de57f9a1bd6d40b8f to your computer and use it in GitHub Desktop.
utcOffset = ->
date = new Date()
jan = new Date(date.getFullYear(), 0, 1);
jul = new Date(date.getFullYear(), 6, 1);
utcOffset = -Math.floor(Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()) * 60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment