Link to home
Start Free TrialLog in
Avatar of prinx
prinx

asked on

date and time

can someone pls show mi a way to get the date(day month year) and time(hour min) ?
ASKER CERTIFIED SOLUTION
Avatar of Alien Life-Form
Alien Life-Form

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of prinx
prinx

ASKER

so...we onli need :
#!/usr/local/bin/perl
use CGI;
$q = new CGI;
print scalar(localtime());
$now=scalar(localtime());
print $q->header();
print "$now"; #print the time
exit;

rite ?
Right.

Actually, you only need the second print.
The first one will actually make your script bomb (you're printing to stdout before outputting the header, and tha's a no-no).


Cheers,
      alf