UTCは現地時間で約25秒差があります。

UTCは現地時間で約25秒差があります。

私はこれを他のシステムで比較しましたが、Arago Linuxを実行している組み込みシステムでのみこの動作を得ました。 BusyBox v.1.13.2の日付コマンドを使用しています。

私はこれら2つのコマンドを「同時に」実行しました。

[root@host:~] date; date -u
Fri Mar 18 12:56:49 CET 2016
Fri Mar 18 11:57:14 UTC 2016

zdumpの出力は予想通りです(+3600秒、+1時間)。

/etc/localtime  Sun Mar 29 01:00:24 2015 UT = Sun Mar 29 01:59:59 2015 CET isdst=0 gmtoff=3600
/etc/localtime  Sun Mar 29 01:00:25 2015 UT = Sun Mar 29 03:00:00 2015 CEST isdst=1 gmtoff=7200
/etc/localtime  Sun Oct 25 01:00:24 2015 UT = Sun Oct 25 02:59:59 2015 CEST isdst=1 gmtoff=7200
/etc/localtime  Sun Oct 25 01:00:25 2015 UT = Sun Oct 25 02:00:00 2015 CET isdst=0 gmtoff=3600
/etc/localtime  Sun Mar 27 01:00:24 2016 UT = Sun Mar 27 01:59:59 2016 CET isdst=0 gmtoff=3600
/etc/localtime  Sun Mar 27 01:00:25 2016 UT = Sun Mar 27 03:00:00 2016 CEST isdst=1 gmtoff=7200
/etc/localtime  Sun Oct 30 01:00:24 2016 UT = Sun Oct 30 02:59:59 2016 CEST isdst=1 gmtoff=7200
/etc/localtime  Sun Oct 30 01:00:25 2016 UT = Sun Oct 30 02:00:00 2016 CET isdst=0 gmtoff=3600
/etc/localtime  Sun Mar 26 01:00:24 2017 UT = Sun Mar 26 01:59:59 2017 CET isdst=0 gmtoff=3600
/etc/localtime  Sun Mar 26 01:00:25 2017 UT = Sun Mar 26 03:00:00 2017 CEST isdst=1 gmtoff=7200

この25秒オフセットはどこから来ましたか?

ベストアンサー1

25秒は、2012年7月1日と2015年7月1日のPOSIX準拠のtz領域と「正しい」tz領域の違いです。 tzdataがそれほど古く、このコマンドを実行するシェルのデフォルトのタイムゾーンがPOSIX CETで、「-u」タイムゾーンがUTCの「正しい」バージョンの場合、「正しい」コードはシステムクロックがPOSIXに違反すると仮定します。実際にはすべてのうるう秒を計算するので、「正しい」コードはシステムクロックを市販に変換する過程でこの25秒を引いたものです。

おすすめ記事