1 ! Copyright (C) 2013 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs calendar kernel math sequences sets
6 { t } [ "PST8PDT" find-zone-rules and >boolean ] unit-test
11 { gmt-offset "-5:00" }
22 { name "Pacific/Kiritimati" }
23 { gmt-offset "14:00" }
29 "Pacific/Kiritimati" timezone>rules last
32 ! First and last timezones + 24 hours = length of day
34 now midnight "Etc/GMT+12" find-zone gmt-offset>> hms>duration >>gmt-offset
35 now midnight "Etc/GMT-14" find-zone gmt-offset>> hms>duration >>gmt-offset
36 time- duration>hours 24 +
39 ! Make sure we handle # in weird places, like in "Europe/Athens"
42 [ [ gmt-offset>> ] map ] map concat members