i'm coding a special dst feature for u.s. residents.
does anyone here outside of the u.s. use daylight saving time?
me
aye, but saving without the latter s
k, i'll add canada and norway.
why do you bother with time zones and dst if all the times and dates displayed are relative?
hold your cursor over the relative times.
aaaahhh
ok, i have these dst schemes:
* null
* usa
* canada
* europe
anyone want anything else? :)
antarctica!
btw, i know that i fucked up the transition hour/min/sec. i gotta figure that out better. :/
damnit, i have to have a different array for each u.s./canada timezone, because they all change their clocks at different times.
europe wins because all of europe changes their clocks at the same time.
p.s. i hate timezones. grr
ok, ttf now has these dst schemes:
* na_pdt
* na_mdt
* na_cdt
* na_edt
* europe
anyone want anything else?
ok, it's up and working.
finally, all ttf times are perfectly in accord with dst. :D
btw, you gotta
pick a scheme
ttf's auto-dst is
not dependent on php 5. but it does require that you code the schemes you want to offer and build a cache. hovever, i've tried to make coding the schemes pretty easy. here is the one for europe:
// EUROPE DST SCHEME
$ttf_dst['eu'] = array();
// 1998 to now --- last sunday in march until last sunday in october --- +1 hour @ 01:00:00 UTC
for ($year = $ttf_epoch_year; $year <= $dst_end_year; $year++) {
$ttf_dst['eu'][$year] = array('begin' => ttf_conceptual_date(0, 0, 3, $year, 1),
'end' => ttf_conceptual_date(0, 0, 10, $year, 1),
'adj' => 1*60*60);
};
auto-dst is
not offered by either fluxbb nor wordpress. but historically they've been slow adopters, such as adoption of utf-8.
i'll explain the ttf_conceptual_date() function too. it's converts a phrase such as "the last sunday in march" into a unix timestamp.
ttf_conceptual_date($ordinal, $day_of_week, $month, $year, $h=0, $m=0, $s=0)
$ordinal -- set to 0 for last, 1 for first, 2 for second, 3 for third, 4 for fourth.
$day_of_week -- set to 0 for sun, 1 for mon, 2 for tues, ... , 6 for sat
$month -- set to 1 for jan, 2 for feb, 3 for mar, ... , 12 for dec
$year -- set to four-digit year
$h -- utc hour when to adjust
$m -- utc minute when to adjust
$s-- utc second when to adjust
for example, europe adds 1 hour at 1 a.m. (utc) on the last sunday of march. so for the year 2009, this transition time is at:
ttf_conceptual_date(0, 0, 3, 2009, 1, 0, 0)
if you can't tell, i'm pretty excited about this stuff. ultimately there will be an admin page that will allow addition of dst schemes and re-generate the cache.
and
a new project was born. :k
lucas is dst's bitch :)
unfortunately. :(
i added alaska, atlantic, and mexico's three zones.
dst currently supported:
europe
na_akdt
na_pdt
na_mdt
na_cdt
na_edt
na_adt
na_mx3
na_mx2
na_mx1
so now there's complete support for north america.