Calendar.parse("%Y-%M-%D %h:%m:%s %z","2003-03-30 23:00:00 Europe/Stockholm");
(5) Result: 0
That is bad. It's probably from the fact that the 23'rd hour doesn't exist 03-30 (see below), but it's still bad. I can't believe noone noticed before?
Calendar.Second(2003,3,30,2,0,0);
(7) Result: Second(Sun 30 Mar 2003 3:00:00 CEST)
This might be a design fault; but the second hour *is* called "3:00". The parse() function corrects this to match the data, but the Second/Minute/Hour constructors doesn't seem to.
Should they?
/ Mirar
Previous text:
2003-03-30 13:24: Subject: Calendar failure
Interesting. The DST shift seems to do bad things to the Calendar module, or vice versa. Below, I am skeptical to (5), and find (7) onwards a bit odd, though perhaps correct as designed?
Pike v7.4 release 13 running Hilfe v3.5 (Incremental Pike Frontend)
Calendar.parse("%Y-%M-%D %h:%m:%s %z","2003-03-30 01:00:00 Europe/Stockholm");
(1) Result: Second(Sun 30 Mar 2003 1:00:00 CET)
Calendar.parse("%Y-%M-%D %h:%m:%s %z","2003-03-30 02:00:00 Europe/Stockholm");
(2) Result: 0
Calendar.parse("%Y-%M-%D %h:%m:%s %z","2003-03-30 03:00:00 Europe/Stockholm");
(3) Result: Second(Sun 30 Mar 2003 3:00:00 CEST)
Calendar.parse("%Y-%M-%D %h:%m:%s %z","2003-03-30 22:00:00 Europe/Stockholm");
(4) Result: Second(Sun 30 Mar 2003 22:00:00 CEST)
Calendar.parse("%Y-%M-%D %h:%m:%s %z","2003-03-30 23:00:00 Europe/Stockholm");
(5) Result: 0
Calendar.Second(2003,3,30,1,0,0);
(6) Result: Second(Sun 30 Mar 2003 1:00:00 CET)
Calendar.Second(2003,3,30,2,0,0);
(7) Result: Second(Sun 30 Mar 2003 3:00:00 CEST)
Calendar.Second(2003,3,30,3,0,0);
(8) Result: Second(Sun 30 Mar 2003 4:00:00 CEST)
Calendar.Second(2003,3,30,22,0,0);
(9) Result: Second(Sun 30 Mar 2003 23:00:00 CEST)
Calendar.Second(2003,3,30,23,0,0);
not in range (second 0..82799 exist) /usr/local/pike/7.4.13/lib/modules/Calendar.pmod/YMD.pmod:871: Day(Sun 30 Mar 2003)->get_unit("second",82800) /usr/local/pike/7.4.13/lib/modules/Calendar.pmod/Time.pmod:128: Second(Sun 30 Mar 2003 0:00:00 CET sharp)->create_backtry(23,0,0) /usr/local/pike/7.4.13/lib/modules/Calendar.pmod/YMD.pmod:2368: Second(Sun 30 Mar 2003 0:00:00 CET sharp)->create_backtry(2003,3,30,23,0,0 ) /usr/local/pike/7.4.13/lib/modules/Calendar.pmod/Time.pmod:109: Second(Sun 30 Mar 2003 0:00:00 CET sharp)->create(2003,3,30,23,0,0) object_program(Calendar.ISO): ISO->cSecond() HilfeInput:1: HilfeInput()->___HilfeWrapper()
/ Johan Sundström (folkskådare)