in reply to Best way of getting YEAR-MONTH-DAY from YEAR-DAYOFYEAR ?

I'd use Date::Calc:
use Date::Calc 'Add_Delta_Days'; my $yyyy_doy = "YYYYDOY"; my ($year, $doy) = $yyyy_doy =~ /(....)(...)/; my ($YYYY, $MM, $DD) = Add_Delta_Days ($year, 1, 1, $doy - 1);
What you want is DOY - 1 days after January 1 of the given year.

No doubt countless other modules on CPAN can do the same thing. But I like Date::Calc and that usually does what I need.

Replies are listed 'Best First'.
Re^2: Best way of getting YEAR-MONTH-DAY from YEAR-DAYOFYEAR ?
by smiffy (Pilgrim) on Oct 01, 2008 at 09:56 UTC

    I'll second Date::Calc - been using it for a few years and has generally done what I need.