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

Discussion in 'Javascript' started by FAQ server, Nov 7, 2007.

  1. FAQ server

    FAQ server Guest

    -----------------------------------------------------------------------
    FAQ Topic - How do I format the 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://jibbering.com/faq/index.html.
    The FAQ workers are a group of volunteers. The sendings of these
    daily posts are proficiently hosted by http://www.pair.com.
    FAQ server, Nov 7, 2007
    #1
    1. Advertising

  2. In comp.lang.javascript message <47310006$0$90275$.
    dk>, Wed, 7 Nov 2007 00:00:02, FAQ server <>
    posted:
    >
    >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.


    If it is agreed that newer browsers return four-digit years, then I
    suggest changing :
    >can occur if the browser returns only two digits for the year.

    to :
    can occur for older browsers returning only two-digit years.

    Do all newer browsers consistently include offset-from-GMT indication;
    and, if any do not, do they consistently give the time in one of GMT,
    user's local?

    --
    (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, 2007
    #2
    1. Advertising

  3. In comp.lang.javascript message <>,
    Fri, 9 Nov 2007 14:31:37, Randy Webb <> posted:
    >Dr J R Stockton said the following on 11/9/2007 7:08 AM:
    >> In comp.lang.javascript message <47310006$0$90275$.
    >> dk>, Wed, 7 Nov 2007 00:00:02, FAQ server <>
    >> posted:
    >>> 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.


    >> If it is agreed that newer browsers return four-digit years, then I
    >> suggest changing :
    >>> can occur if the browser returns only two digits for the year.

    >> to :
    >> can occur for older browsers returning only two-digit years.


    >And then change it back if a new browser comes out with a bug that
    >returns a two-digit year?


    Do you seriously think .... that even Merkin browser-writers would be
    that stupid?

    On the same basis you should restore the older Trim code, since RegExps
    might get omitted or broken.

    However, if you read what I wrote with due care, you should see that
    "can occur for older browsers returning only two-digit years" refers
    only to older browsers, and would remain true if new browsers appeared
    with two-digit years. It would then be clear to the intelligent reader
    that the new browsers would in this respect behave as the older ones.

    --
    (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr J R Stockton, Nov 10, 2007
    #3
    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:
    91
    FAQ server
    Sep 12, 2006
  2. FAQ server
    Replies:
    1
    Views:
    196
    Dr J R Stockton
    Nov 9, 2006
  3. FAQ server
    Replies:
    0
    Views:
    141
    FAQ server
    Jan 6, 2007
  4. FAQ server
    Replies:
    0
    Views:
    86
    FAQ server
    Mar 9, 2007
  5. FAQ server
    Replies:
    1
    Views:
    92
    Evertjan.
    May 8, 2007
Loading...

Share This Page