LoginSignup
0
0

More than 5 years have passed since last update.

【JSTとCSTとUTC】

Posted at

【JSTとCSTとUTC】

 

JST:日本標準時間

CST:米国中部標準時間

UTC:世界で標準時として使っている時間

【アプリ内の時間】

ある地域で共通している時刻系をその国の標準時と呼びます。
地理的にある程度近い地域では共通の時刻を使いましょうということになってます。

標準時やタイムゾーンはUTCを基準に何時間進んでいるか or 遅れているかで表現されます。
日本標準時(JST)はUTCより9時間進んでいるので +09:00 というような表記になります。

2.4.2 :003 > Time.zone_default
=> #ActiveSupport::TimeZone:0x00007f9c009e5450 @name="Asia/Tokyo", @utc_offset=nil, @tzinfo=#>
2.4.2 :004 > Time.zone.now
=> Sat, 13 Oct 2018 09:56:54 JST +09:00

設定場所

config/applicarion.rb設定ファイルの config.time_zone
ActiveSupport::TimeWithZoneがこの設定値を参照する
規定値:UTC

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0