comparison lisp/calendar/cal-dst.el @ 4667:dbe2da5db2f7

(calendar-time-zone-daylight-rules): Remove special case for Israel. Israel has changed its daylight savings time rules, and we don't know what the current rules are.
author Paul Eggert <eggert@twinsun.com>
date Mon, 06 Sep 1993 22:37:51 +0000
parents 031aaf217dc3
children 1079bcdb68b4
comparison
equal deleted inserted replaced
4666:674082454a0c 4667:dbe2da5db2f7
151 (calendar-for-loop j from (max 2 (- d 6)) to (min d (- last 8)) do 151 (calendar-for-loop j from (max 2 (- d 6)) to (min d (- last 8)) do
152 (setq l 152 (setq l
153 (cons 153 (cons
154 (list 'calendar-nth-named-day 1 weekday m 'year j) 154 (list 'calendar-nth-named-day 1 weekday m 'year j)
155 l))) 155 l)))
156 l) 156 l)))
157 ;; Israel is special.
158 (if (zerop weekday)
159 (if (< m 7)
160 (list
161 '(calendar-gregorian-from-absolute
162 (calendar-dayname-on-or-before
163 0
164 (calendar-absolute-from-hebrew
165 (list 1 28 (+ year 3760))))))
166 (list '(calendar-gregorian-from-absolute
167 (calendar-dayname-on-or-before
168 0
169 (- (calendar-absolute-from-hebrew
170 (list 7 1 (+ year 3761))) 3))))))))
171 (prevday-sec (- -1 utc-diff)) ;; last sec of previous local day 157 (prevday-sec (- -1 utc-diff)) ;; last sec of previous local day
172 (year (1+ y))) 158 (year (1+ y)))
173 ;; Scan through the next few years until only one rule remains. 159 ;; Scan through the next few years until only one rule remains.
174 (while 160 (while
175 (let ((rules candidate-rules) 161 (let ((rules candidate-rules)
308 For example, if daylight savings time is mandated to start on October 1, 294 For example, if daylight savings time is mandated to start on October 1,
309 you would set `calendar-daylight-savings-starts' to 295 you would set `calendar-daylight-savings-starts' to
310 296
311 '(10 1 year) 297 '(10 1 year)
312 298
313 For a more complex example, daylight savings time begins in Israel on the 299 If it starts on the first Sunday in April, you would set it to
314 first Sunday after Passover ends on Nisan 21: 300
315 301 '(calendar-nth-named-day 1 0 4 year)
316 '(calendar-gregorian-from-absolute
317 (calendar-dayname-on-or-before
318 0
319 (calendar-absolute-from-hebrew (list 1 28 (+ year 3760)))))
320
321 because Nisan is the first month in the Hebrew calendar.
322 302
323 If the locale never uses daylight savings time, set this to nil.") 303 If the locale never uses daylight savings time, set this to nil.")
324 304
325 (defvar calendar-daylight-savings-ends 305 (defvar calendar-daylight-savings-ends
326 (or (car (nthcdr 5 calendar-current-time-zone-cache)) 306 (or (car (nthcdr 5 calendar-current-time-zone-cache))
330 This is an expression in the variable `year' whose value gives the Gregorian 310 This is an expression in the variable `year' whose value gives the Gregorian
331 date in the form (month day year) on which daylight savings time ends. It is 311 date in the form (month day year) on which daylight savings time ends. It is
332 used to determine the starting date of daylight savings time for the holiday 312 used to determine the starting date of daylight savings time for the holiday
333 list and for correcting times of day in the solar and lunar calculations. 313 list and for correcting times of day in the solar and lunar calculations.
334 314
335 For example, daylight savings time ends in Israel on the Sunday Selichot 315 For example, if daylight savings time ends on the last Sunday in October:
336 begins: 316
337 317 '(calendar-nth-named-day -1 0 10 year)
338 '(calendar-gregorian-from-absolute
339 (calendar-dayname-on-or-before
340 0
341 (- (calendar-absolute-from-hebrew (list 7 1 (+ year 3761))) 3)))
342 318
343 If the locale never uses daylight savings time, set this to nil.") 319 If the locale never uses daylight savings time, set this to nil.")
344 320
345 (defvar calendar-daylight-savings-starts-time 321 (defvar calendar-daylight-savings-starts-time
346 (or (car (nthcdr 6 calendar-current-time-zone-cache)) 120) 322 (or (car (nthcdr 6 calendar-current-time-zone-cache)) 120)