Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To get the date at the CGI...

Status
Not open for further replies.

Unearthphobia

Programmer
Jul 16, 2002
8
0
0
IR
Hi to everybody!
I can't do anything, please HELP with your knowledges!
How can I get the current date from the CGI script?
Thanks...
Aleksey.
PS: Sorry for MY ENGLISH :(...
 
Check out the localtime function. Here's a few examples:

$date = localtime;
print "$date\n"; # outputs - Mon Jul 22 16:32:36 2002

@date = localtime;
$dayofmon = $date[3];
$mon = $date[4] + 1; # 1st month is 0
$year = $date[5] + 1900; # year relative to 1900
print "today's date is ${mon}/${dayofmon}/${year}\n";
# outputs - today's date is 7/22/2002
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top