Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

Current Date plus One Month

Quote Reply
Current Date plus One Month
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.
Subject Author Views Date
Thread Current Date plus One Month jai 4041 May 16, 2004, 4:39 AM
Thread Re: [jai] Current Date plus One Month
olivers 4004 May 17, 2004, 3:21 AM
Thread Re: [olivers] Current Date plus One Month
jai 3990 May 17, 2004, 5:51 AM
Thread Re: [jai] Current Date plus One Month
olivers 3992 May 17, 2004, 6:08 AM
Thread Re: [olivers] Current Date plus One Month
jai 3976 May 17, 2004, 6:31 AM
Thread Re: [jai] Current Date plus One Month
olivers 3988 May 17, 2004, 7:08 AM
Thread Re: [olivers] Current Date plus One Month
jai 3965 May 18, 2004, 4:46 AM
Post Re: [jai] Current Date plus One Month
olivers 3969 May 18, 2004, 5:48 AM