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

Re: [olivers] Current Date plus One Month

Quote Reply
Re: [olivers] Current Date plus One Month In reply to
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);
}

Subject Author Views Date
Thread Current Date plus One Month jai 6287 May 16, 2004, 4:39 AM
Thread Re: [jai] Current Date plus One Month
olivers 6189 May 17, 2004, 3:21 AM
Thread Re: [olivers] Current Date plus One Month
jai 6181 May 17, 2004, 5:51 AM
Thread Re: [jai] Current Date plus One Month
olivers 6185 May 17, 2004, 6:08 AM
Thread Re: [olivers] Current Date plus One Month
jai 6168 May 17, 2004, 6:31 AM
Thread Re: [jai] Current Date plus One Month
olivers 6179 May 17, 2004, 7:08 AM
Thread Re: [olivers] Current Date plus One Month
jai 6155 May 18, 2004, 4:46 AM
Post Re: [jai] Current Date plus One Month
olivers 6153 May 18, 2004, 5:48 AM