#!/usr/bin/perl

use POSIX qw(mktime);

my $date = $ARGV[0];

if ($date =~m#(\d\d)/(\d\d)/\d?\d?(\d\d)#) {
	$date = sprintf("%04d%02d%02d","20$3",$2,$1);
}

	(my @olddate = $date =~m/(\d{4})(\d{2})(\d{2})/) || die "I'm fick. I don'tgetcha date format.";

$olddate[0]-=1900;
$olddate[1]--;
my @db = localtime();

my $diff = time - scalar mktime($db[0], $db[1], $db[2], $olddate[2], $olddate[1],$olddate[0]);
#print "$olddate[0] $olddate[1] $olddate[2]\n";
#print "$db[5] $db[4] $db[3]\n";
print "$diff\n";
