On Jan 29, 2008, at 03:19, Zefram wrote:
David E. Wheeler wrote:
return $date lt '03-21' ? 'winter'
: $date lt '06-21' ? 'spring'
Northern hemisphere chauvinism.
It was a very limited need, in Virginia, so good enough.
Aside from the hemisphere issue, the code is also
David E. Wheeler wrote:
return $date lt '03-21' ? 'winter'
: $date lt '06-21' ? 'spring'
Northern hemisphere chauvinism.
Aside from the hemisphere issue, the code is also wrong for tropical
latitudes, where the four-season system doesn't apply. If you're trying
to answer a
Zefram schreef:
Sounds like you're looking for the equinox and solstice dates. I don't
see any CPAN module providing this, on search.cpan.org.
Take a look at the DateTime::Util::Astro modules. solar_longitude_before
and _after are useful to look for equinoxes and solstices, but you don't
need
Hey All,
Someone on the Bricolage list needed a season method, so I whipped up
this ugly one:
sub season {
my $date = shift-strftime('%m-%d');
return $date lt '03-21' ? 'winter'
: $date lt '06-21' ? 'spring'
: $date lt '09-21' ? 'summer'
David E. Wheeler wrote:
Hey All,
Someone on the Bricolage list needed a season method, so I whipped up
this ugly one:
sub season {
my $date = shift-strftime('%m-%d');
return $date lt '03-21' ? 'winter'
: $date lt '06-21' ? 'spring'
: $date lt
David,
for some reason I *knew* you would be trying SolarTerm...
Of course apparently the test failed for you (which seem to pass on my
laptop, by the way), but anyhow.
I was actually going to reply to this thread, but then I realized that
DT::Event::SolarTerm isn't really worth it because