[#43996] ある日付の最終時刻の求め方 (秒単位) — SATOH Fumiyasu <fumiyas@...>

さとうふみやす @ OSS テクノロジです。

14 messages 2007/09/05
[#43998] Re: ある日付の最終時刻の求め方 (秒単位) — "GOTO Kentaro" <gotoken@...> 2007/09/05

07/09/05 に SATOH Fumiyasu<fumiyas@osstech.jp> さんは書きました:

[ruby-list:44015] Re: ある日付の最終時刻の求め方 (秒単位)

From: Tanaka Akira <akr@...>
Date: 2007-09-07 14:10:05 UTC
List: ruby-list #44015
In article <46E14143.1020907@syd.odn.ne.jp>,
  松房 一郎 <adj41380@syd.odn.ne.jp> writes:

> 夏時間(DST)の始まる日、終わる日も最終時刻は23:59:59ではなく
> なります。もちろん日本では考慮する必要はないし、何のために最

夏時間(DST)の始まる日、終わる日で最後の秒が 23:59:59 の場合
は存在します。

たとえば、ニューヨークでは、今年、3月11日に夏時間が始まりま
したが、01:59:59 の 1秒後が 03:00:00 になるだけで、その日の
最後の秒は 23:59:59 のままです。

% zdump -v America/New_York|grep 2007
America/New_York  Sun Mar 11 06:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 EST isdst=0 gmtoff=-18000
America/New_York  Sun Mar 11 07:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 EDT isdst=1 gmtoff=-14400
America/New_York  Sun Nov  4 05:59:59 2007 UTC = Sun Nov  4 01:59:59 2007 EDT isdst=1 gmtoff=-14400
America/New_York  Sun Nov  4 06:00:00 2007 UTC = Sun Nov  4 01:00:00 2007 EST isdst=0 gmtoff=-18000

もちろん、いわれるように最後の秒が 23:59:59 でない場合もあり
えて、探してみるとたとえばモスクワの 1992年3月28日は
22:59:59 が最後の秒のようです。

% zdump -v Europe/Moscow|grep 1992
Europe/Moscow  Sat Jan 18 23:59:59 1992 UTC = Sun Jan 19 01:59:59 1992 MSK isdst=0 gmtoff=7200
Europe/Moscow  Sun Jan 19 00:00:00 1992 UTC = Sun Jan 19 03:00:00 1992 MSK isdst=0 gmtoff=10800
Europe/Moscow  Sat Mar 28 19:59:59 1992 UTC = Sat Mar 28 22:59:59 1992 MSK isdst=0 gmtoff=10800
Europe/Moscow  Sat Mar 28 20:00:00 1992 UTC = Sun Mar 29 00:00:00 1992 MSD isdst=1 gmtoff=14400
Europe/Moscow  Sat Sep 26 18:59:59 1992 UTC = Sat Sep 26 22:59:59 1992 MSD isdst=1 gmtoff=14400
Europe/Moscow  Sat Sep 26 19:00:00 1992 UTC = Sat Sep 26 22:00:00 1992 MSK isdst=0 gmtoff=10800

ただ、2000年以降だとそういう例は見つかりませんでした。
もし最近の例を御存じでしたら教えてください。

ところで、22:59:59 が最後というのは、その直後の秒が翌日に飛
ぶからですが、逆に、前日に飛ぶという場合もあります。

たとえば Canada/Newfoundland の 2007年11月3日から 4日がそう
で、この場合、23:59:59 が 2回存在します。最初の 23:59:59 の
後に 4日になりますが、1分経つと 3日の 23:01:00 に戻り、さら
に 59分ほどで 2回目の 23:59:59 になり、4日に続きます。

% zdump -v Canada/Newfoundland|grep 2007
Canada/Newfoundland  Sun Mar 11 03:30:59 2007 UTC = Sun Mar 11 00:00:59 2007 NST isdst=0 gmtoff=-12600
Canada/Newfoundland  Sun Mar 11 03:31:00 2007 UTC = Sun Mar 11 01:01:00 2007 NDT isdst=1 gmtoff=-9000
Canada/Newfoundland  Sun Nov  4 02:30:59 2007 UTC = Sun Nov  4 00:00:59 2007 NDT isdst=1 gmtoff=-9000
Canada/Newfoundland  Sun Nov  4 02:31:00 2007 UTC = Sat Nov  3 23:01:00 2007 NST isdst=0 gmtoff=-12600

まぁ、最後の秒が 23:59:59 であることはおそらく確かなんでしょ
うが... そもそも最後の秒って、なんなんでしょうね。
-- 
[田中 哲][たなか あきら][Tanaka Akira]

In This Thread

Prev Next