Sunday, January 01, 2017

[yactpuij] Observations of the leap second

The following script documents the system clock going backward at the leap second.

#!/bin/bash
for (( i=0 ; ; i++ ))
do echo -n $i" "
date --iso=ns
done

Feed into gzip or bzip2 or xz then kill the script process by PID (not ^C, because that will kill the compression program).

Ubuntu 14.04

13293621 2016-12-31T18:59:59,996480552-0500
13293622 2016-12-31T18:59:59,998502752-0500
13293623 2016-12-31T19:00:00,000424730-0500
13293624 2016-12-31T19:00:00,002255494-0500
13293625 2016-12-31T19:00:00,003949090-0500
13293626 2016-12-31T19:00:00,005448105-0500
13293627 2016-12-31T18:59:59,007054958-0500
13293628 2016-12-31T18:59:59,008465206-0500

Ubuntu 16.04

45948121 2016-12-31T18:59:59,999325546-05:00
45948122 2016-12-31T18:59:59,999808163-05:00
45948123 2016-12-31T19:00:00,000337888-05:00
45948124 2016-12-31T19:00:00,000877926-05:00
45948125 2016-12-31T19:00:00,001407343-05:00
45948126 2016-12-31T19:00:00,001934319-05:00
45948127 2016-12-31T19:00:00,002418765-05:00
45948128 2016-12-31T19:00:00,002899595-05:00
45948129 2016-12-31T19:00:00,003372363-05:00
45948130 2016-12-31T18:59:59,004051384-05:00
45948131 2016-12-31T18:59:59,004808767-05:00

The following script is described here.  We can observe the repetition of 23:59:33 as the system clock goes backward (as above), then later 23:59:60.

for (( i = 0 ; ; i++)) ; do echo -n $i" " ;TZ=right/UTC date --iso=ns ; sleep 0.33 ; done

56853 2016-12-31T23:59:31,198116288+0000
56854 2016-12-31T23:59:31,530940907+0000
56855 2016-12-31T23:59:31,863877362+0000
56856 2016-12-31T23:59:32,196930593+0000
56857 2016-12-31T23:59:32,529740731+0000
56858 2016-12-31T23:59:32,863085326+0000
56859 2016-12-31T23:59:33,196001280+0000
56860 2016-12-31T23:59:33,528957882+0000
56861 2016-12-31T23:59:33,862031907+0000
56862 2016-12-31T23:59:33,194771050+0000
56863 2016-12-31T23:59:33,527665662+0000
56864 2016-12-31T23:59:33,861096024+0000
56865 2016-12-31T23:59:34,194124683+0000
56866 2016-12-31T23:59:34,527900279+0000
56867 2016-12-31T23:59:34,861187587+0000
...
56940 2016-12-31T23:59:59,175893786+0000
56941 2016-12-31T23:59:59,508957877+0000
56942 2016-12-31T23:59:59,841721314+0000
56943 2016-12-31T23:59:60,174499990+0000
56944 2016-12-31T23:59:60,507358020+0000
56945 2016-12-31T23:59:60,840145798+0000
56946 2017-01-01T00:00:00,173087257+0000
56947 2017-01-01T00:00:00,506015576+0000
56948 2017-01-01T00:00:00,838836886+0000

Future project: observe what happens to the RTC (hwclock).

No comments:

Post a Comment