FAQ Topic - How do I format Last Modified date with javascript

Discussion in 'Javascript' started by FAQ server, Nov 9, 2006.

  1. FAQ server

    FAQ server Guest

    -----------------------------------------------------------------------
    FAQ Topic - How do I format Last Modified date with javascript
    -----------------------------------------------------------------------

    Apparently, « new Date() » reads it correctly, though problems
    can occur if the browser returns only two digits for the year.
    In particular, time zone, field order and separators may vary.
    It is also reliant on the server's clock having been correctly
    set at the time of upload. See the URL
    below.

    http://www.merlyn.demon.co.uk/js-date2.htm#lM


    ===
    Postings such as this are automatically sent once a day. Their
    goal is to answer repeated questions, and to offer the content to
    the community for continuous evaluation/improvement. The complete
    comp.lang.javascript FAQ is at http://www.jibbering.com/faq/.
    The FAQ workers are a group of volunteers.
     
    FAQ server, Nov 9, 2006
    #1
    1. Advertising

  2. In message <45526f86$0$49200$>, Thu, 9 Nov 2006
    00:00:02, FAQ server <> writes
    >-----------------------------------------------------------------------
    >FAQ Topic - How do I format Last Modified date with javascript
    >-----------------------------------------------------------------------
    >
    >Apparently, ‹ new Date() › reads it correctly, though problems
    >can occur if the browser returns only two digits for the year.
    >In particular, time zone, field order and separators may vary.
    >It is also reliant on the server's clock having been correctly
    >set at the time of upload. See the URL
    >below.
    >
    >http://www.merlyn.demon.co.uk/js-date2.htm#lM



    That's correct, IMHO. But I think it gives insufficient stress to
    variations between browsers.

    "The format of the document.lastModified string is browser-dependent. In
    particular, time zone and indication, field order and separators may
    vary. Doubtless ‹ new Date(dlM) › will understand the format, but
    error can occur if the browser returns only two digits for the year.
    Validity is also reliant on the server's clock having been correctly set
    at the time of upload. See the URL below."

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
    Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
    PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
    Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
     
    Dr J R Stockton, Nov 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FAQ server
    Replies:
    0
    Views:
    97
    FAQ server
    Sep 12, 2006
  2. FAQ server
    Replies:
    0
    Views:
    147
    FAQ server
    Jan 6, 2007
  3. FAQ server
    Replies:
    0
    Views:
    96
    FAQ server
    Mar 9, 2007
  4. FAQ server
    Replies:
    1
    Views:
    103
    Evertjan.
    May 8, 2007
  5. FAQ server
    Replies:
    0
    Views:
    95
    FAQ server
    Jul 9, 2007
Loading...

Share This Page