#!/usr/bin/perl use strict; use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use Date::Calc qw(Delta_Days); use Date::Calc qw[Add_Delta_Days Today]; my $q = new CGI; print $q->header; my $got_date = "1/1/2010"; # this is only to show, but this is the format of the date I will be getting from the db table. my ($got_month,$got_day,$got_year) = split /\//, $got_date; # split date in 3 parts with / as delimiter my ($year, $month, $day) = Today(); my @today = ($year, $month, $day); my @date_got = ($got_year, $got_month, $got_day); my $difference = Delta_Days(@date_got, @today); print "There were $difference days between Today and Stored Date\n\n";