![]() |
Server Question
Can anyone who sets up or manages servers help me with this question:
I have a new domain on a new server. When running Perl scripts I cannot get DATE_GMT or DATE_LOCAL to work. Perl requests like: $gmtdate = $ENV{'DATE_GMT'}; and $localdate = $ENV{'DATE_LOCAL'}; return an empty string. When I asked my host about this they said to include the following SSI into my HTML: Code:
If it helps I have the following server info: SERVER_SOFTWARE = Apache/2.2.6 (Fedora) SERVER_PROTOCOL = INCLUDED GATEWAY_INTERFACE = CGI/1.1 Thanks. |
Those Environment variables won't always be available in CGI, so, you really cannot depend on them. SSI parses them using the Apache environment which does set those variables.
You could do something like: Code:
print "Content-type: text/html\n\n"; Code:
print `date "+%b %d, %Y"`; There are also calendar libraries available or you could write something using localtime/gmtime Code:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = Remember that $mon returns 0-11 for Jan-Dec, and the year needs 1900 added to it. |
All times are GMT -4. The time now is 04:15 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc