You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by "Heiss, Christian" <Ch...@Datentechnik-Moll.De> on 2003/05/22 14:59:04 UTC
Request->ServerVariables(LastModified)
Dear Sirs,
Just have a few problems with:
"<% print $Request->ServerVariables(LastModified => time ()); %>"
I think this syntax is used to get the date of last modification for the
currently ...!
Ok, I get something, but ... it's not the way I like.
The output is: 1053607494 (lol) ..the date from the year... 01.01.1970...
or something else
What's wrong with my configuration?
In httpd.conf:
...
<Directory /www/dtm>
Options ExecCGI Includes Indexes FollowSymLinks
AllowOverride All
XBitHack Full
AddType text/html .shtml
AddHandler server-parsed .shtml .html .incl .inc
<Files *.asp>
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global /www/dtm/global
PerlSetVar UseStrict 1
</Files>
....
And in the index.asp like above!
If I use a index.html with: <!--#echo var="LAST_MODIFIED" -->
The output is correct!!! Like> Thursday, 22-May-2003 13:39:56 CEST
Thanks for your help
Best regards
Christian
Re: Request->ServerVariables(LastModified)
Posted by Thanos Chatziathanassiou <tc...@arx.net>.
I think there's nothing wrong with Your setup.
It's just the Perl way of returning time. In seconds since the ``epoch''.
Now, most modern operating systems clasim that the epoch started at
January 1,1970 00:00:00 GMT.
If you want a more human-readable format, You can try localtime() and
stuff. You may also do funky stuff with time() using e.g. Date::Calc,
Date::Manip or the POSIX module, that will allow you to format the time
string to anything you like (bear in mind that the POSIX module is
notoriously memory-hungry and generally bloated).
Also, I don't really know if that will do, as (at least my own) server
variables doesn't provide this information. I mostly use stat for that
functionality (try ``perldoc -f stat'').
Regards,
Thanos Chatziathanassiou
Heiss, Christian wrote:
> Dear Sirs,
>
>
> Just have a few problems with:
>
> "<% print $Request->ServerVariables(LastModified => time ()); %>"
>
>
> I think this syntax is used to get the date of last modification for
> the currently ...!
>
> Ok, I get something, but ... it's not the way I like.
> The output is: 1053607494 (lol) ..the date from the year...
> 01.01.1970... or something else
>
>
> What's wrong with my configuration?
>
> In httpd.conf:
> ...
> <Directory /www/dtm>
> Options ExecCGI Includes Indexes FollowSymLinks
> AllowOverride All
> XBitHack Full
> AddType text/html .shtml
> AddHandler server-parsed .shtml .html .incl .inc
>
> <Files *.asp>
> SetHandler perl-script
> PerlHandler Apache::ASP
> PerlSetVar Global /www/dtm/global
> PerlSetVar UseStrict 1
> </Files>
> ....
>
> And in the index.asp like above!
>
>
> If I use a index.html with: <!--#echo var="LAST_MODIFIED" -->
> The output is correct!!! Like> Thursday, 22-May-2003 13:39:56 CEST
>
> Thanks for your help
> Best regards
>
> Christian
>
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Request->ServerVariables(LastModified)
Posted by Nikolay Melekhin <ni...@mtu-net.ru>.
Hello!
Use HTTP::Date module for date conversion.
--
Best regards, Nikolay Melekhin
nikolay_melehin@mtu-net.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org