Probably the longest follow up to a post, but I've just tried this and I can't get it to work. Any one any ideas, I'm sure I've probably done something stupid ?
The GT::Date::date_diff just seems to return a result of zero.
This is the code and this is the result I get "0 2006-05-31, 2005-07-11"
Code:
sub {
## pass the customer ID
use GT::Date qw/date_diff/;
my $customer_id = shift;
my $expiry_date = $DB->table('customers')->select( { cus_id => $customer_id}, ['cus_supportexpiry'])->fetchrow;
my $dates;
my $today = GT::Date::date_get();
($dates->{today_date},$dates->{today_time}) = split / / => $today;
my $temp_date = $dates->{today_date};
my $overdue = GT::Date::date_diff($temp_date,$expiry_date);
return qq|$overdue $expiry_date, $temp_date|;