Let me explain you how it works on my system:
this is my globel "date_add":
sub {
my ($datefield, $add_days) = @_;
require GT::Date;
use GT::Date qw /:all/;
my $date_added = date_add($datefield, $add_days);
return $date_added;
}
This is how I call it in the HTML template:
<%date_add($nameofmydatefield,'%mm%','30')%>
For example: if you have a db field called "specialdate", you could put <%date_add($specialdate,'%mm%','30')%> and this would be the calculated output (date in specialdate field plus 30 days). I don't know what you exactly want to do with the timelocal thingy in your sub. And I'm also wondering what kind of date field type you have defined in MySQL.
Thanks for more info
Oliver
this is my globel "date_add":
Code:
sub {
my ($datefield, $add_days) = @_;
require GT::Date;
use GT::Date qw /:all/;
my $date_added = date_add($datefield, $add_days);
return $date_added;
}
This is how I call it in the HTML template:
Code:
<%date_add($nameofmydatefield,'%mm%','30')%>
For example: if you have a db field called "specialdate", you could put <%date_add($specialdate,'%mm%','30')%> and this would be the calculated output (date in specialdate field plus 30 days). I don't know what you exactly want to do with the timelocal thingy in your sub. And I'm also wondering what kind of date field type you have defined in MySQL.
Thanks for more info
Oliver