Skip to content

Instantly share code, notes, and snippets.

@rc1021
Created June 29, 2012 06:54
Show Gist options
  • Save rc1021/3016366 to your computer and use it in GitHub Desktop.
Save rc1021/3016366 to your computer and use it in GitHub Desktop.
設定時間
# 記得先在 ec2 設定時間
# ls -F /usr/share/zoneinfo/
# ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
# vi /etc/sysconfig/clock # 修改 clock 為台灣時間
ZONE="Asia/Taipei"
# config/application.rb
config.time_zone = 'Taipei'
config.active_record.default_timezone = :local
# 使用方法
gmt_t = Time.now
utc_t = Time.now.utc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment