timezone

Reference: Time Zones

Challenge: TimeZones and TimeStamps! When coding & configuring different systems, you have the potential of mismatched timezones. The aim of this post is to provide an ongoing guide to discovering your environments’ timestamps and updating to reflect the proper zone.

Mac:

get: sudo systemsetup -gettimezone

see options: sudo systemsetup -listtimezones

set: sudo systemsetup -settimezone "America/New_York"

Docker:

get container date/time: docker exec running_container_name date

set (add to Dockerfile): 

ENV TZ=America/New_York

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Rails / ActiveRecord:

set (in /config/application.rb):

config.time_zone = 'Eastern Time (US & Canada)'

config.active_record.default_timezone = :local

get (in rails console):

Time.zone

Heroku:

set: heroku config:add TZ="America/New_York"

RasPi:

set: sudo raspi-config, International Options… … reboot

 

Reference:
http://apple.stackexchange.com/questions/117994/is-there-a-fast-way-to-switch-system-time-zone-from-the-command-line

http://tedwise.com/2015/05/02/setting-the-timezone-in-a-docker-image

http://stackoverflow.com/questions/6118779/how-to-change-default-timezone-for-active-record-in-rails