[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date?



Dan Walker schrieb:
> 
> Hiya, Pi3ers. I'm running into a common thing with the wwwboard scripts
> I'm trying to use, so I thought someone out there must know the answer
> to this one...
> 
> Basically, they're all calling for a "date" command, that apparantly is
> usually available on Unix servers. Does Pi3Web have an equivalent of
> this command? If so, could someone educate me on how to use it?
> 
^^^^ Hi, the script uses an OS command, it is more a question of CGI/perl
than a question of the web server to get the date functionality OS
independant. I use date in my own scripts with the build in perl functions
time/localtime:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

and format it into a string with timestamp format in English order:

$timestamp = sprintf("%02.0f\:%02.0f\:%02.0f %02.0f/%02.0f/%02.0f",
   $hour,$min,$sec,$mon+1,$mday,$year);

The whole family of time related functions in perl (so far I know):
gmtime, localtime, time, times

Since I'm busy with some perl scripts specific for the Pi3web server
I recommend to have a look at:

http://home.t-online.de/home/zimpel@t-online.de/seite6.htm

Hint: You must have a Perl 5 version running these scripts.

I still look for testers for these scripts and a message board is under
construction too.

Your supposition - if Pi3Web supports date/time functions isn't absurd, 
but it possibly won't help to solve your problem so read the following
only for your information: 

You could use SSI-variables to print date/time from within a server parsed
SHTML page:
<!--#echo var="DATE_GMT"-->
<!--#echo var="DATE_LOCAL"-->
<!--#echo var="LAST_MODIFIED"-->

There's also a Pi3-expression variable $t containing a timestamp but this
value isn't available from within CGI scripts by default.

Have a nice Sunday!

> Thanks, y'all! :)
> 
> Dan
> 
> Over Now Productions
> http://overnow.ml.org/ or http://come.to/overnow
> overnowbaby@hotmail.com
> featuring the Youth Empowerment Authority and the Soap
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com

-- 
with regards
Holger

---------------------------------------------------------
Holger 'Zimpel' Zimmermann    Contact me:
---------------------------------------------------------
Wendishain                    tel./fax company: on demand
Germany                       tel./fax private: on demand
---------------------------------------------------------
homepage: http://home.t-online.de/home/zimpel@t-online.de
web server: surf to it from my homepage (online every
            Sunday 20:00-24:00 GMT, start 1. June 1998)
e-Mail:     zimpel@t-online.de
--------------------------------------------------------