タイムゾーンをUTCで運用するノウハウ
Dropboxの運用で、細かいけれど役に立つノウハウが書かれていたのでメモ。 DropboxはDBから何から内部のタイムスタンプはUTCを使っているらしい。
Dropbox のスケールとか – Kosei Kitahara’s Blog 経由 Rajiv’s blog - Scaling lessons learned at Dropbox, part 1 UTC Keep everything in UTC internally! Server times, stuff in the database, etc. This will save lots of headaches, and not just daylight savings time. Some software just doesn’t even handle non-UTC time properly, so don’t do it! We kept a clock on the wall set to UTC. When you want to display times to a user, make the timezone conversion happen at the last second.
ポイントは、「We kept a clock on the wall set to UTC.」というところ。
ちなみに自分が今開発中のソフトウェアは、内部のタイムスタンプを全てUTCで保持しているので早速採用。自分の腕時計をUTCに設定した。
これで、ログが何時間前かがわかりやすくなった。ちょっとした工夫でも効果抜群。
24時間時計なので、意外とサマになったり。