in reply to Comparing Dates With a Twist
#!/usr/bin/perl -wT use strict; use POSIX qw(mktime); my $oct7 = daysago(7,10,2001); print "October 7th was $oct7 days ago\n"; sub daysago { my $day = shift; my $month = shift; my $year = shift; my $then = mktime((localtime)[0..2], $day, $month-1, $year-1900); my $delta = time - $then; return int($delta/60/60/24); } =OUTPUT October 7th was 24 days ago
-Blake
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |