LoginSignup
9
9

More than 5 years have passed since last update.

Vagrant上で時刻がずれている時の対処法

Last updated at Posted at 2014-10-02

Vagrant上で開発しているときに、現在の日付と時刻を見る為に $ date コマンド を打つと、表示される時刻でがおかしい場合があります。

現在、日本国内で時計をみると「2014年10月2日10:46:45」となっているとします。

vagrant上で


$ date
2014年 10月  2日 木曜日 01:46:45 UTC

UTC(全世界で時刻を記録する際に使われる公式な時刻「 協定世界時」)になってしまっていますね。日本標準時刻より 9時間 遅れています。

実際は、JST(日本の標準時刻)で表示されてほしいので


$ sudo rm /etc/localtime
$ sudo ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

として時刻を日本の標準時刻に戻しましょう。


$ date
$ 2014年 10月  2日 木曜日 10:46:45 JST
9
9
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
9
9