powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
My question is this...popup_menu(-name=>"saleend", -values=> ["","1","2","3","4","5","6","7","14","21","always"], -labels=>{ "" => "Select One", "1" => "1 Day", "2" => "2 Days", "3" => + "3 Days", "4" => "4 Days", "5" => "5 Days", "6" => "6 Days", "7" => +"1 Week", "14" => "2 Weeks", "21" => "3 Weeks", "always" => "Everyday +" }, -default=>"", -class=>"select_menu");
What I'm trying to do, is ADD that much time, in seconds, to the current date. Then I'm inserting that into the database. That way I can have it automatically turn the sales OFF, after they reach the amount of days she gives them.my $saleend = localtime() + ($in{saleend} * 24 * 60 * 60) unless $in{s +aleend} eq "always"; my $saleend = localtime() + (365 * 24 * 60 * 60) if $in{saleend} eq "a +lways";
Is there a easier way to do this?my $saleend = time + ($in{saleend} * 24 * 60 * 60) unless $in{saleend} + eq "always"; my $saleend = time + (365 * 24 * 60 * 60) if $in{saleend} eq "always";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: add to localtime?
by Limbic~Region (Chancellor) on Apr 26, 2003 at 19:58 UTC | |
by powerhouse (Friar) on Apr 26, 2003 at 21:34 UTC | |
by perlplexer (Hermit) on Apr 26, 2003 at 22:44 UTC | |
by powerhouse (Friar) on Apr 27, 2003 at 04:44 UTC | |
|
Re: add to localtime?
by Mr. Muskrat (Canon) on Apr 26, 2003 at 19:56 UTC |