Created
April 4, 2015 21:50
-
-
Save yukas/4601086b49fb19824850 to your computer and use it in GitHub Desktop.
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
# Set current application time zone to user's one | |
def set_time_zone | |
Time.zone = current_user.time_zone if user_signed_in? | |
end | |
# Somewhere in code | |
Time.zone.now # obtain current time in current user's time zone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment