Created
June 29, 2012 06:54
-
-
Save rc1021/3016366 to your computer and use it in GitHub Desktop.
設定時間
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
# 記得先在 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