I have a script which gives me the day of the millenium. It goes something like this:
#!/usr/bin/perl
require "cgi-lib.pl";
print &PrintHeader;
# Get the date and time information
($Seconds, $Minutes, $Hours, $DayInMonth, $Month, $ShortYear, $DayOfWeek, $DayOfYear, $IsDST) = localtime(time);
# Fix the year to keep it Y2K compliant
$Year = $ShortYear + 1900;
$DayNumber = (($Year-2000)*365)+ $DayOfYear;
print <<"EOF";
<html><body>
Today is approximately day number $DayNumber of the millenium.
</body></html>
EOF
#End of program
That's all very well, if I want to know what day of the millenium it is today. But what if I want to know what day of the millenium it will be on 14 June 2005?
In other words, if I receive the date, month and year as form inputs, how will I calculate the day of the millenium?
Thanks for your help.
#!/usr/bin/perl
require "cgi-lib.pl";
print &PrintHeader;
# Get the date and time information
($Seconds, $Minutes, $Hours, $DayInMonth, $Month, $ShortYear, $DayOfWeek, $DayOfYear, $IsDST) = localtime(time);
# Fix the year to keep it Y2K compliant
$Year = $ShortYear + 1900;
$DayNumber = (($Year-2000)*365)+ $DayOfYear;
print <<"EOF";
<html><body>
Today is approximately day number $DayNumber of the millenium.
</body></html>
EOF
#End of program
That's all very well, if I want to know what day of the millenium it is today. But what if I want to know what day of the millenium it will be on 14 June 2005?
In other words, if I receive the date, month and year as form inputs, how will I calculate the day of the millenium?
Thanks for your help.