Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Paul] show future date

Quote Reply
Re: [Paul] show future date In reply to
the following global works to calculate 180 days (30days*6months) from today

Code:
sub {
# Displays six months from today.
Links::init_date();
my $date1 = GT::Date::date_get();
my $date2 = GT::Date::date_add($date1, 30 * 6);
GT::Date::date_set_format($CFG->{'date_db_format'});
return $date2;
}


the problem is that i cannot assume 30 days for every month... what i really need is to add 6 months (ie. if it is 2003-02-22, then return 2003-08-22), not 180 days... i can't create an array out of month and add six (ie. 11 + 6 = 17... a nonsensical month)... any thoughts on how can i calculate 6 months and display in YYYY-MM-DD format?... i've reviewed the GT::Date help, but don't see this issue addressed... thanks in advance
Subject Author Views Date
Thread show future date kysa 2696 Apr 1, 2003, 10:14 AM
Thread Re: [kysa] show future date
Paul 2625 Apr 1, 2003, 10:18 AM
Post Re: [Paul] show future date
kysa 2600 Apr 1, 2003, 11:34 AM
Thread Re: [kysa] show future date
Paul 2620 Apr 1, 2003, 12:04 PM
Thread Re: [Paul] show future date
kysa 2562 Apr 6, 2003, 6:59 PM
Thread Re: [kysa] show future date
pugdog 2561 Apr 6, 2003, 7:09 PM
Post Re: [pugdog] show future date
kysa 2542 Apr 7, 2003, 7:49 AM