my $dt = DateTime->new( year => $yyyy, month => 1, day => 1 ); $dt->add( days => $doy ); print $dt->strftime( '%Y%m%d' );