Eugene van der Pijll wrote:
If I were to implement these time scales for DateTime, I would probably
implement them as subclasses of UT1 (or "LMT") and LAT, with the
geographical longitude as parameter; "LMT+46d43m27s" for Riyadh legal
time, for example. But your notation is reasonable as well.

DateTime::TimeZone::LMT already exists .. though without the ability to set the longitude via stringification

my $riyadh_lmt = DateTime::TimeZone::LMT->new(
    longitude => 46 + (43 / 60) + (27 / 3600)
);

$now = DateTime->now( time_zone => $riyadh_lmt );

A thought: it might be good to somehow include the ability to load other TZ modules from a string. Eg. time_zone => "LMT/46d43m27s" would look for LMT/46d43m27s.pm and failing that, drop back to looking for LMT.pm and pass it's constructor the '46d43m27s'.

Cheers!
Rick Measham

Reply via email to