Created
May 18, 2017 04:56
-
-
Save wbotelhos/ad3d1ca17a87ae713752a77a47078ffc to your computer and use it in GitHub Desktop.
Timezone Offset in hours
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
def offset_in_hours(time_zone) | |
TZInfo::Timezone.get(time_zone).current_period.offset.utc_total_offset.to_f / 3600.0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment