setTimeout o.ä. verwenden
ivo seidel
- cgi
0 Cheatah0 ivo seidel0 Cheatah
0 Michael Schröpl
Hallo alle zusammen,
ich habe ein cgi welches die ServerTime auslist (diese wird dann mit der lokalen Time verglichen)
das cgi habe ich über <!--#exec cgi=../cgi-bin/time.cgi--> in ein formular eingebunden. läuft auch alles fine :-)
nun möchte ich aber aller 1 minute das cgi neu ausführen um die aktuelle servertime zu bekommen. geht das? wenn ja, wer hat ne idee dazu?
ps: es laüft nebenbei noch das javascript welches mir jede sekunden die lokale zeit auswirft. ..onload="window.setTimeout ('uhr ()',1000)">
vielen dank für eure hilfe
gruss
ivo
Hi,
nun möchte ich aber aller 1 minute das cgi neu ausführen um die aktuelle servertime zu bekommen. geht das?
ausschließlich, indem irgendein clientseitiger Mechanismus dafür sorgt, dass die Seite neu angefordert wird.
ps: es laüft nebenbei noch das javascript welches mir jede sekunden die lokale zeit auswirft. ..onload="window.setTimeout ('uhr ()',1000)">
Das ist dann sinnfrei.
Cheatah
Das ist dann sinnfrei.
Cheatah
mit verlaub: der vergleich zwischen der zeit des clients und der zeit der zeit servers ist mitnichten sinnfrei :-)
man denke nur an zeitkritische bestellvorgänge. denn bindend ist der eingang der bestellung auf dem server. ich muss dem user also klar machen, dass "seine" uhr anders geht, demnach nicht relevant ist.
ciao
ivo
Hi,
mit verlaub: der vergleich zwischen der zeit des clients und der zeit der zeit servers ist mitnichten sinnfrei :-)
das JavaScript-setTimeout() jedoch schon, nachdem Du in der selben Frequenz die Seite neu vom Server lädst. Drum sagte ich auch, es sei "dann" sinnfrei.
Cheatah
Hi,
ich habe ein cgi welches die ServerTime auslist
völliger overkill. Das kann SSI alleine auch:
Today's date
<!--#echo var="DATE_LOCAL" -->
The echo element just spits out the value of a variable. There are a number of standard variables, which include the whole set of environment variables that are available to CGI programs. Also, you can define your own variables with the set element.
If you don't like the format in which the date gets printed, you can use the config element, with a timefmt attribute, to modify that formatting.
<!--#config timefmt="%A %B %d, %Y" -->
Today is <!--#echo var="DATE_LOCAL" -->
(http://httpd.apache.org/docs/howto/ssi.html)
Viele Grüße
Michael
völliger overkill. Das kann SSI alleine auch:
danke - wusste ich noch nicht. kommt natürlich besser :-)
muss ichs bloss noch in die richtige form bringen.
ciao
ivo
völliger overkill. Das kann SSI alleine auch:
danke - wusste ich noch nicht. kommt natürlich besser :-)
muss ichs bloss noch in die richtige form bringen.
Die Informationen dazu sind in der Tat ein wenig verstreut:
timefmt
-------
The value is a string to be used by the strftime(3) library routine when printing dates.
http://httpd.apache.org/docs/mod/mod_include.html
... und als nächstes dann ein "man strftime", das sagt nun folgendes:
Each conversion specification is replaced by appropriate
characters as described in the following list. The appropri-
ate characters are determined by the LC_TIME category of the
program's locale and by the values contained in the struc-
ture pointed to by timeptr for strftime() and ascftime(),
and by the time represented by clock for cftime().
%% Same as %.
%a Locale's abbreviated weekday name.
%A Locale's full weekday name.
%b Locale's abbreviated month name.
%B Locale's full month name.
%c Locale's appropriate date and time representation.
Default
%C Locale's date and time representation as produced by
date(1).
Standard-conforming
%C Century number (the year divided by 100 and truncated
to an integer as a decimal number [1,99]); single
digits are preceded by 0; see standards(5).
%d Day of month [1,31]; single digits are preceded by 0.
%D Date as %m/%d/%y.
%e Day of month [1,31]; single digits are preceded by a
space.
%g Week-based year within century [00,99].
%G Week-based year, including the century [0000,9999].
%h Locale's abbreviated month name.
%H Hour (24-hour clock) [0,23]; single digits are pre-
ceded by 0.
%I Hour (12-hour clock) [1,12]; single digits are pre-
ceded by 0.
%j Day number of year [1,366]; single digits are preceded
by 0.
%k Hour (24-hour clock) [0,23]; single digits are pre-
ceded by a blank.
%l Hour (12-hour clock) [1,12]; single digits are pre-
ceded by a blank.
%m Month number [1,12]; single digits are preceded by 0.
%M Minute [00,59]; leading 0 is permitted but not
required.
%n Insert a NEWLINE.
%p Locale's equivalent of either a.m. or p.m.
%r Appropriate time representation in 12-hour clock for-
mat with %p.
%R Time as %H:%M.
%S Seconds [00,61]; the range of values is [00,61] rather
than [00,59] to allow for the occasional leap second
and even more occasional double leap second.
%t Insert a TAB.
%T Time as %H:%M:%S.
%u Weekday as a decimal number [1,7], with 1 representing
Monday. See NOTES below.
%U Week number of year as a decimal number [00,53], with
Sunday as the first day of week 1.
%V The ISO 8601 week number as a decimal number [01,53].
In the ISO 8601 week-based system, weeks begin on a
Monday and week 1 of the year is the week that
includes both January 4th and the first Thursday of
the year. If the first Monday of January is the 2nd,
3rd, or 4th, the preceding days are part of the last
week of the preceding year. See NOTES below.
%w Weekday as a decimal number [0,6], with 0 representing
Sunday.
%W Week number of year as a decimal number [00,53], with
Monday as the first day of week 1.
%x Locale's appropriate date representation.
%X Locale's appropriate time representation.
%y Year within century [00,99].
%Y Year, including the century (for example 1993).
%Z Time zone name or abbreviation, or no bytes if no time
zone information exists.
If a conversion specification does not correspond to any of
the above or to any of the modified conversion specifica-
tions listed below, the behavior is undefined and 0 is
returned.
Das kann also ganz schön viel ... ;-)
Viele Grüße
Michael