Gossamer Forum
Home : General : Perl Programming :

Date format issue

Quote Reply
Date format issue
The developers of our site left an error on the site and we're just now realizing it. Basically, this is a script that checks availability of services and after the users inputs the information and click Continue they see a screen with an animated gif and the scripts is to print:

if($sth[0]->rows) {
message("Checking Availability of " . $services,"<img src='/img/waiting.gif' vspace=5 hspace=130><br><br>We are checking local availability for your $event_name on $event_date","/login.cgi?availability_check=1&lead_info_id=$lead_info_id",9000);
}

Where $event_date is the date the user previously input through three select boxes choosing Month Day and Year. The code which builds $event_date is:

my ($d, $m, $y) = (localtime)[3,4,5];
$y += 1900;
$m++;
my $event_date = "$m/$d/$y";

This clearly calls for localtime as opposed to the date to print and thus users are seeing todays date in place of the event date they specified in the form which is confusing them to no end. I know we need to use:

$in{month}
$in{day}
$in{year}

I'm just not sure the exact syntax that will make the site display the proper date.

Any help would be greatly appreciated.

Thanks,

Justin
Quote Reply
Re: [expyinc] Date format issue In reply to
my ($d, $m, $y) = ($in{day}, $in{month}, $in{year});

or:

my ($d, $m, $y) = @in{qw/day month year/};


???

Last edited by:

Wychwood: Oct 26, 2007, 1:37 PM