I have a global named "current_date" as follows -
sub {
my ($date, $format) = @_;
require GT::Date;
my $unix_time = GT::Date::timelocal(GT::Date::parse_format($date, "%yyyy%-%mm%-%dd% %hh%:%MM%:%ss%"));
return GT::Date::date_get($unix_time, $format);
}
In my html template I have the following -
<%current_date($var_date, "%mm%")%>
This returns the current date in two digit format (e.g the month of May is returned as 05).
I put the above code together from searching various GT posts, so don't know if it's the correct way to achieve the result but it seems to work. I also use the other parts of the date (year, day, time, etc.) in another template.
Now, what I want to do is display the next month (e.g plus one month. So if it's May, I want to display 06 for June).
How can I do that from within the html template?
I tried -
<%current_date($var_date, "%mm%") + 1%>
but it doesn't do the job.
Any ideas?
Thank you.
sub {
my ($date, $format) = @_;
require GT::Date;
my $unix_time = GT::Date::timelocal(GT::Date::parse_format($date, "%yyyy%-%mm%-%dd% %hh%:%MM%:%ss%"));
return GT::Date::date_get($unix_time, $format);
}
In my html template I have the following -
<%current_date($var_date, "%mm%")%>
This returns the current date in two digit format (e.g the month of May is returned as 05).
I put the above code together from searching various GT posts, so don't know if it's the correct way to achieve the result but it seems to work. I also use the other parts of the date (year, day, time, etc.) in another template.
Now, what I want to do is display the next month (e.g plus one month. So if it's May, I want to display 06 for June).
How can I do that from within the html template?
I tried -
<%current_date($var_date, "%mm%") + 1%>
but it doesn't do the job.
Any ideas?
Thank you.