Time Zone Abbreviations – Worldwide ListAbbreviationTime zone name Location Offset
時刻の扱いは難しい。タイムゾーンを跨ぐと格別に難しい。 Rails を使っていても難しさに変わりはない。むしろ時刻のやっかいな部分を隠蔽してくれるが故に余計にややこしくなることもある。 config.time_zone と config.active_record.default_timezone Rails アプリケーションで時刻を司る代表的な設定値は config.time_zone と config.active_record.default_timezone だ。いずれも config/application.rb で設定できる。詳細は Ruby on Rails Guides: Configuring Rails Applications 参照。 config.time_zone でアプリケーションのタイムゾーンを設定する。デフォルトでは UTC になる。日本向けのウェブサイトで
Amazon EC2で提供されている公式イメージでFedoraを選んだのですが、当然ながら国外で作られているイメージなので、timezoneがEDT(Eastern Daylight Saving Time: 米国東部夏時間)になっていました。 以下、Fedoraの場合の日本時間(JST)への変更手順メモ。(CentOSについても同様です。) # date Fri Apr 25 04:32:47 EDT 2008 # cp /usr/share/zoneinfo/Japan /etc/localtime cp: overwrite `/etc/localtime'? y # date Fri Apr 25 17:33:10 JST 2008 ちなみに、Debian GNU/Linuxの場合は、コチラ(d:id:rx7:20080219:p1)
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く