#!/usr/bin/perl -w use strict; use Time::Local qw( timelocal ); my $year = 2001; my $day = 200; my $year_sec = timelocal(0, 0, 0, 1, 0, $year-1900); my $new_sec = $year_sec + ($day-1) * 60 * 60 *24; print localtime($new_sec)."\n"; my ($theday, $month) = (localtime($new_sec))[3,4]; $month++; print "day = $theday, month = $month\n";