Re: Detect Tme Zone

Tech-Archive recommends: Fix windows errors by optimizing your registry



These statements display the current (local) time with UTC offset

var d = new Date()
document.write (d)

For me, it displayed
Thu Oct 13 14:36:20 UTC+1000 2005
(Australia is 10 hours ahead of UTC)

You could extract the offset itself by searching the string for "UTC" and
taking the next 5 characters.

I display local time on my website by using the toLocale functions

function getTheDate()
{// returns local date
var now = new Date()
return now.toLocaleDateString()
}
//------------------------------

function getTheTime()
{// returns local time
var now = new Date()
return now.toLocaleTimeString()
}
//------------------------------
But
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

Bruce A. Julseth wrote:
> How do I determine the time zone my client is running in?
>
> Thank you.
>
> Bruce


.



Relevant Pages

  • Re: Display a block of text in Firefox & Safari
    ... in FireFox and Safari it appears as a narrow ... There seems to be a needless reliance on the global variable 'NumberOfQuestionsShown', I've suggested a different strategy below that should be easier to maintain - it uses a single class to hide/show questions so the script doesn't need to know how many questions there are nor do they need to be consecutively numbered. ... var questionNum; ... Instead of going through all questions, how about giving them all the same style, then just modify the style to change display from 'none' to ''. ...
    (comp.lang.javascript)
  • Great background color slider but needs a small modification (help pls)
    ... In searching for a good background color chooser I came across this ... figure out how to display the value of cCol in a box. ... What is missing is a text box that displays the currently set ... var sPosition; ...
    (comp.lang.javascript)
  • Re: change images
    ... Use visibility:hidden instead of display. ... var htmlSnippets = new Array; ... function showMe(optionNumber, owner) { ... What is the purpose of the body positioning? ...
    (comp.lang.javascript)
  • Re: TOD Clock the same as the BIOS clock in PCs?
    ... I have been told that the TOD clock similar to the RTC/CMOS clock ... do they log their times in UTC time also? ... But, do they actually display the LOCAL TIME on the VTAM, ...
    (bit.listserv.ibm-main)
  • Re: Outputting XML via JavaScript
    ... var x = xmlDoc.getElementsByTagName; ... var row = document.createElement; ... var container = document.createElement; ... Once again, I am loading it on body onload, and whenever I am trying to move the data around to use divs and display like I provided, I get various issues. ...
    (comp.lang.javascript)