Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to have ExpiryDate = $today + 30

Quote Reply
How to have ExpiryDate = $today + 30
Hi,

I would like to set up ExpryDate automatically for all links to today +30 days
I wanted to modify sub add_linkin add.pm
$input->{Mod_Date} = $today;
in this place:
Links::init_date();
my $today = GT::Date::date_get();
$input->{Add_Date} = $today;
$input->{Mod_Date} = $today;

Unforntunetely I do not mange to cope with the unix date format of EXpiryDate

thanks in advance for your answers,

Vercyb
Quote Reply
Re: [vercyb] How to have ExpiryDate = $today + 30 In reply to
my $today = GT::Date::date_get();
$input->{ExpiryDate} = GT::Date::timelocal(GT::Date::parse_format(GT::Date::date_add($today,30)));

Seems to work... even it is not very elegant....
Quote Reply
Re: [vercyb] How to have ExpiryDate = $today + 30 In reply to
Hi,

Try:

$input->{ExpiryDate} = GT::Date::date_get(time + 30 * 86400);

(86400 is number of seconds in a day).

Cheers,

Alex
--
Gossamer Threads Inc.