Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22197

Re: OT: Displaying current time on a website

From Rhino <no_offline_contact_please@example.com>
Newsgroups comp.lang.javascript
Subject Re: OT: Displaying current time on a website
Date 2013-11-27 16:15 -0500
Organization A noiseless patient Spider
Message-ID <l75ncg$qc2$1@dont-email.me> (permalink)
References <l70gbn$b7j$1@dont-email.me> <l70tc3$i40$1@dont-email.me> <l736ib$pgs$1@dont-email.me> <l738t2$738$1@dont-email.me> <52964acb$0$6635$9b4e6d93@newsspool2.arcor-online.net>

Show all headers | View raw


On 2013-11-27 2:41 PM, Christoph Michael Becker wrote:
> Rhino wrote:
>
>> On 2013-11-26 5:15 PM, Rhino wrote:
>>> On 2013-11-25 8:26 PM, Beauregard T. Shagnasty wrote:
>>>>
>>>> BTW, your sample page with the time display fails if JavaScript is
>>>> disabled, as it is in my browsers nearly all the time.
>>>>
>>> Good point. I'll replace the Javascript with a Server Side Include of
>>> DATE_LOCAL.
>>>
>>
>> Blast! Now I remember why I liked the JavaScript approach over the SSI
>> approach: the JavaScript approach actually updated the seconds on the
>> clock once every second. The SSI approach does NOT refresh the time
>> every second.
>>
>> What is the best way of displaying the current time so that the seconds
>> advance once per second? (Again, I'm assuming the customer can't be
>> persuaded to stop showing the current time on the web page.)
>
> In your case I would emit the current time with SSI, and update the time
> with browser side scripting -- if that is disabled or not available at
> all, the visitor sees the time of the request, at least.  However, both
> times may be considerably different due to timezone differences.
>
Interesting idea. How would I get the time from SSI but update it every 
second via my HTML? I've got the SSI part already but I'm at a loss how 
to update that time  on an ongoing basis.

> F'up to comp.lang.javascript
>


-- 
Rhino

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: OT: Displaying current time on a website Rhino <no_offline_contact_please@example.com> - 2013-11-27 16:15 -0500
  Re: OT: Displaying current time on a website Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-28 01:11 +0000
    Re: OT: Displaying current time on a website "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-11-28 11:20 +0200
      Re: OT: Displaying current time on a website Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-29 00:12 +0000
        Re: OT: Displaying current time on a website Andrew Poulos <ap_prog@hotmail.com> - 2013-11-29 13:51 +1100
        Re: OT: Displaying current time on a website Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-29 10:58 +0100
    Re: OT: Displaying current time on a website Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-11-29 21:30 +0000
  Re: OT: Displaying current time on a website Stefan Weiss <krewecherl@gmail.com> - 2013-11-28 23:09 +0100
    Re: OT: Displaying current time on a website tony@mountifield.org (Tony Mountifield) - 2013-11-28 23:24 +0000
      Re: OT: Displaying current time on a website tony@mountifield.org (Tony Mountifield) - 2013-11-29 13:12 +0000
        Re: OT: Displaying current time on a website Stefan Weiss <krewecherl@gmail.com> - 2013-11-29 14:39 +0100
        Re: OT: Displaying current time on a website Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-11-30 20:35 +0000
          Re: OT: Displaying current time on a website "Evertjan." <exjxw.hannivoort@interxnl.net> - 2013-12-01 07:57 +0000

csiph-web