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

Re: [jai] Current Date plus One Month

Quote Reply
Re: [jai] Current Date plus One Month In reply to
Let me explain you how it works on my system:

this is my globel "date_add":

Code:

sub {
my ($datefield, $add_days) = @_;
require GT::Date;
use GT::Date qw /:all/;
my $date_added = date_add($datefield, $add_days);

return $date_added;
}


This is how I call it in the HTML template:

Code:

<%date_add($nameofmydatefield,'%mm%','30')%>


For example: if you have a db field called "specialdate", you could put <%date_add($specialdate,'%mm%','30')%> and this would be the calculated output (date in specialdate field plus 30 days). I don't know what you exactly want to do with the timelocal thingy in your sub. And I'm also wondering what kind of date field type you have defined in MySQL.

Thanks for more info
Oliver
Subject Author Views Date
Thread Current Date plus One Month jai 6325 May 16, 2004, 4:39 AM
Thread Re: [jai] Current Date plus One Month
olivers 6226 May 17, 2004, 3:21 AM
Thread Re: [olivers] Current Date plus One Month
jai 6218 May 17, 2004, 5:51 AM
Thread Re: [jai] Current Date plus One Month
olivers 6222 May 17, 2004, 6:08 AM
Thread Re: [olivers] Current Date plus One Month
jai 6205 May 17, 2004, 6:31 AM
Thread Re: [jai] Current Date plus One Month
olivers 6217 May 17, 2004, 7:08 AM
Thread Re: [olivers] Current Date plus One Month
jai 6192 May 18, 2004, 4:46 AM
Post Re: [jai] Current Date plus One Month
olivers 6190 May 18, 2004, 5:48 AM