"Updated * hours * minutes ago" Script

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

    #1

    "Updated * hours * minutes ago" Script

    Is there a way of producing a script to automatically update and show:

    "Updated x hours and x minutes ago on xx/xx/xx"

    I currently have a script to automatically show the date and time the page
    was last updated in the format:

    "Updated February 5, 2004 at 23:24 "

    although would like to take this a little bit further and make it a little
    more interesting.


    Many thanks




  • Dr John Stockton

    #2
    Re: "Update d * hours * minutes ago" Script

    JRS: In article <bvuk7r$gre$1@n ews8.svr.pol.co .uk>, seen in
    news:comp.lang. javascript, Steevo <steevo@uk2k.no spam.com> posted at
    Thu, 5 Feb 2004 23:39:32 :-[color=blue]
    >Is there a way of producing a script to automatically update and show:
    >
    >"Updated x hours and x minutes ago on xx/xx/xx"
    >
    >I currently have a script to automatically show the date and time the page
    >was last updated in the format:
    >
    >"Updated February 5, 2004 at 23:24 "
    >
    >although would like to take this a little bit further and make it a little
    >more interesting.[/color]


    What do you want to know that cannot be found by using the newsgroup
    FAQ?

    Be aware that, since the author updated the page, it should be most
    fitting to give this information for the author's time zone.

    However, the author's time zone is AIUI unknowable, unless he chooses to
    code it in.

    Since the web is world-wide, the date/time can reasonably be given in
    GMT; and that is how Last-Modified: is sent. Some browsers give
    lastModified in GMT, without zonal indication; some with GMT - they may,
    of course not get it right, so testing is desirable.

    Remember that 24 hours before noon on Mar 28 2004 is 11:00h Mar 27 2004.


    The reliable way is to train yourself to edit the date and time of the
    change, with "GMT", in the HTML. Be wary of "BST"; it is used for
    British Summer Time, Brazil Standard Time, and Bering Summer Time (at
    least).

    --
    © 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> jscr maths, dates, sources.
    <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

    Comment

    • Steevo

      #3
      Re: &quot;Update d * hours * minutes ago&quot; Script

      "Dr John Stockton" <spam@merlyn.de mon.co.uk> wrote in message
      news:QhFoErRe68 IAFw6D@merlyn.d emon.co.uk...[color=blue]
      > JRS: In article <bvuk7r$gre$1@n ews8.svr.pol.co .uk>, seen in
      > news:comp.lang. javascript,
      >
      > What do you want to know that cannot be found by using the newsgroup
      > FAQ?
      >
      > Be aware that, since the author updated the page, it should be most
      > fitting to give this information for the author's time zone.
      >
      > However, the author's time zone is AIUI unknowable, unless he chooses to
      > code it in.
      >
      > Since the web is world-wide, the date/time can reasonably be given in
      > GMT; and that is how Last-Modified: is sent. Some browsers give
      > lastModified in GMT, without zonal indication; some with GMT - they may,
      > of course not get it right, so testing is desirable.
      >
      > Remember that 24 hours before noon on Mar 28 2004 is 11:00h Mar 27 2004.
      >
      >
      > The reliable way is to train yourself to edit the date and time of the
      > change, with "GMT", in the HTML. Be wary of "BST"; it is used for
      > British Summer Time, Brazil Standard Time, and Bering Summer Time (at
      > least).
      >
      > --[/color]

      Many thanks for your post. Unfortunatly I think you may have misunderstood
      my need. I am looking for a script which will add "Updated * hours * minutes
      ago" before my current script which displays the date/time of the last
      update.

      Many thanks once again




      Comment

      Working...