Need help with Time Validation in JavaScript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Megha Vishwanath

    Need help with Time Validation in JavaScript

    Hi,

    We have an application where my clients may be at different timezones.
    I need to validate time across the timezones with javascript. The date
    object in JavaScript does not allow me to get the timezone.

    Any implementation suggestions?

    Thanks

    -Megha.
  • Thomas 'PointedEars' Lahn

    #2
    Re: Need help with Time Validation in JavaScript

    Megha Vishwanath wrote:
    [color=blue]
    > We have an application where my clients may be at different timezones.
    > I need to validate time across the timezones with javascript. The date
    > object in JavaScript does not allow me to get the timezone.[/color]

    You're wrong, see



    PointedEars

    Comment

    • Dr John Stockton

      #3
      Re: Need help with Time Validation in JavaScript

      JRS: In article <bmm8mc$oi5rm$1 @ID-107532.news.uni-berlin.de>, seen in
      news:comp.lang. javascript, Thomas 'PointedEars' Lahn
      <PointedEars@we b.de> posted at Thu, 16 Oct 2003 16:08:50 :-[color=blue]
      >Megha Vishwanath wrote:
      >[color=green]
      >> We have an application where my clients may be at different timezones.
      >> I need to validate time across the timezones with javascript. The date
      >> object in JavaScript does not allow me to get the timezone.[/color]
      >
      >You're wrong, see
      >http://devedge.netscape.com/library/...ference/date.h
      >tml#1193844[/color]

      The Date Object allows access to the TimezoneOffset of the executing
      computer, for the date/time in the Object, assuming the OS is correctly
      set. But it knows nothing of remote Timezones and summer time rules.

      With an annual exception in Spring, and with allowance for the way (for
      example) Germans spell October, time validation is independent of time
      location.

      But MV may need to validate a remote civil time against a GMT range.

      See below, in particular js-date5.htm#DDTA which tests code for reading
      Remote Time. Note : at present, the code re-parses TZ for every
      conversion; I'm thinking about improving that.

      However, if the remote time is local to the remote browser, then
      javascript can readily give GMT; if time is in multiple zones, one
      should generally use GMT.

      --
      © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
      <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
      <URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
      <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.

      Comment

      Working...