Does anyone know why Time.local gives these offsets here? (+0100 is
correct)
IIRC, daylight saving time was first introduced as a wartime
energy-saving measure. So prior to its introduction, Britain was on GMT
(+0000) even in the summer.
Does anyone know why Time.local gives these offsets here? (+0100 is correct)
% TZ=Europe/Madrid ruby -ve ‘p Time.local(2010); p Time.local(1940); p
Time.local(1807)’
ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux]
Fri Jan 01 00:00:00 +0100 2010
Mon Jan 01 00:00:00 +0000 1940
Thu Jan 01 00:00:00 -0014 1807
% TZ=Europe/Madrid ./ruby -ve ‘p Time.local(2010); p Time.local(1940);
p Time.local(1807)’
ruby 1.9.3dev (2010-08-26 trunk 29102) [x86_64-linux]
2010-01-01 00:00:00 +0100
1940-01-01 00:00:00 +0000
1807-01-01 00:00:00 -0014
% TZ=Europe/Madrid ./ruby -ve ‘p Time.local(2010); p Time.local(1940);
p Time.local(1807)’
ruby 1.9.2p0 (2010-08-18 revision 29034) [x86_64-linux]
2010-01-01 00:00:00 +0100
1940-01-01 00:00:00 +0000
1807-01-01 00:00:00 -0015
% zdump -v Europe/Madrid|head
Europe/Madrid -9223372036854775808 = NULL
Europe/Madrid -9223372036854689408 = NULL
Europe/Madrid Tue Jan 1 00:14:43 1901 UTC = Mon Dec 31 23:59:59 1900
LMT isdst=0 gmtoff=-884
Europe/Madrid Tue Jan 1 00:14:44 1901 UTC = Tue Jan 1 00:14:44 1901
WET isdst=0 gmtoff=0
Europe/Madrid Sat May 5 22:59:59 1917 UTC = Sat May 5 22:59:59 1917
WET isdst=0 gmtoff=0
Europe/Madrid Sat May 5 23:00:00 1917 UTC = Sun May 6 00:00:00 1917
WEST isdst=1 gmtoff=3600
Europe/Madrid Sat Oct 6 22:59:59 1917 UTC = Sat Oct 6 23:59:59 1917
WEST isdst=1 gmtoff=3600
Europe/Madrid Sat Oct 6 23:00:00 1917 UTC = Sat Oct 6 23:00:00 1917
WET isdst=0 gmtoff=0
Europe/Madrid Mon Apr 15 22:59:59 1918 UTC = Mon Apr 15 22:59:59 1918
WET isdst=0 gmtoff=0
Europe/Madrid Mon Apr 15 23:00:00 1918 UTC = Tue Apr 16 00:00:00 1918
WEST isdst=1 gmtoff=3600
% zdump -v Europe/Madrid|grep 2010
Europe/Madrid Sun Mar 28 00:59:59 2010 UTC = Sun Mar 28 01:59:59 2010
CET isdst=0 gmtoff=3600
Europe/Madrid Sun Mar 28 01:00:00 2010 UTC = Sun Mar 28 03:00:00 2010
CEST isdst=1 gmtoff=7200
Europe/Madrid Sun Oct 31 00:59:59 2010 UTC = Sun Oct 31 02:59:59 2010
CEST isdst=1 gmtoff=7200
Europe/Madrid Sun Oct 31 01:00:00 2010 UTC = Sun Oct 31 02:00:00 2010
CET isdst=0 gmtoff=3600
It seems Madrid used different timezone rules in these days:
LMT (local mean time) and WET/WEST.
It wasn’t until 1847 that Greenwich Mean Time was widely used across the
UK. Before then, everyone used “solar time”, which means that clocks at
different points of the country (east to west) hit noon at different
times. The difference would be 60 minutes for every 15 degrees of
longitude.
So if you were standing at St Paul’s Cathedral, say, noon would be
slightly later compared to noon in Greenwich, which is a bit to the
East.
In your case: Madrid has a longitude of 3 degrees 42 mins West. So the
offset of Madrid solar time from GMT is:
Sorry, I should engage brain before typing. Jan 1st is not in the
summer, and you are in Western Europe.
Also, although daylight saving time WAS initiated as a war time
measure, the war was WW I, it was the Germans and their allies who
started it but Britain and other countries soon followed suit.