473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

"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


Jul 20 '05 #1
2 3010
JRS: In article <bv**********@news8.svr.pol.co.uk>, seen in
news:comp.lang.javascript, Steevo <st****@uk2k.nospam.com> posted at
Thu, 5 Feb 2004 23:39:32 :-
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.

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.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #2
"Dr John Stockton" <sp**@merlyn.demon.co.uk> wrote in message
news:Qh**************@merlyn.demon.co.uk...
JRS: In article <bv**********@news8.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).

--


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


Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
3
by: | last post by:
Hello, I am hoping someone else has thought about a date time calculation i need to perform. I would like to be able to calculate the number of "working minutes" between 2 dates, given my...
0
by: (PeteCresswell) | last post by:
A friend who does technical writing offers his clients a "Bucket Of Hours" deal. The client chooses a number of hours, pays for 1/3 of the hours up front and the friend commits to doing whatever...
2
by: Michiel Sikma | last post by:
Hello everybody. I recently had a bit of data loss and, among some other minor things, lost my bookmarks. I once bookmarked this video tutorial which allegedly showed how to make a wiki in 10...
6
by: JamesG | last post by:
I'm trying to convert a unix timestamp to a readable time, such as 4 hours ago, or 25 minutes ago. My code is below: function ago($ts) { /* time difference */ $ts = (time() - $ts); if($ts <...
2
brettl
by: brettl | last post by:
Hey all. I'm not sure if this question should be posted here or in the XML forums. Please forgive me if its in the wrong place or feel free to move it. Any who, I'm using a SOAP service to...
1
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
Puzzled escribió: You don't mention what your DBMS is so I'll assume you're using the only one that exists, MySQL. Check the max allowed packet size: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.