This function returns the day-of-the-year as a floating point number.
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isday) = localtime time(); my $doty = sprintf "%g", ($yday + $hour/24 + $min/1440.);