Hi Oliver,
Thank you for your reply.
I've been playing around with the code you supplied but for some reason it's not giving me the correct current date or calculating the new date. I had to declare one of your variables (in red) to get the code to run but then it's giving me a current date of 1969 for the year and 12 for the month. I think the problem is in the sub and not my template (as changing the code in the template makes no difference to what is displayed).
Do you have any ideas as to what might be causing this?
Thank you.
sub {
my ($date, $format, $add_days) = @_;
require GT::Date;
use GT::Date qw /:all/;
my $unix_time = GT::Date::timelocal(GT::Date::parse_format($date, "%yyyy%-%mm%-%dd% %hh%:%MM%:%ss%"));
my $unix_time_added = date_add($unix_time, $add_days);
return GT::Date::date_get($unix_time_added, $format);
}
Thank you for your reply.
I've been playing around with the code you supplied but for some reason it's not giving me the correct current date or calculating the new date. I had to declare one of your variables (in red) to get the code to run but then it's giving me a current date of 1969 for the year and 12 for the month. I think the problem is in the sub and not my template (as changing the code in the template makes no difference to what is displayed).
Do you have any ideas as to what might be causing this?
Thank you.
sub {
my ($date, $format, $add_days) = @_;
require GT::Date;
use GT::Date qw /:all/;
my $unix_time = GT::Date::timelocal(GT::Date::parse_format($date, "%yyyy%-%mm%-%dd% %hh%:%MM%:%ss%"));
my $unix_time_added = date_add($unix_time, $add_days);
return GT::Date::date_get($unix_time_added, $format);
}