View Full Version : Date & Time Stamp On My Website???
Subir Chadha
03-13-2003, 11:43 AM
I am building a new website & I would like & date & time stamp on it. Like the one @ www.btopenworld.com (http://). I have looked @ the ones @ JavaFile.com but there aren’t really what I’m looking for. I want just a plain JavaScript or JavaApplet that can tell you the time & the date. I don’t even mind if there are 2 one that tells you the date & one that tells you the time. Does anyone know a website where I can find some of what I’m looking for. Or will someone be VERY nice & make me one?
PLEASE HELP ME!
Thanks in advance. :thumbsup:
BTW…I think this is the right forum to post it in!
beetle
03-13-2003, 04:02 PM
I knocked together a quick DateStamp class that uses a couple of my other classes (http://www.peterbailey.net/dev/jsclasses/) to make inserting date stamps easy :D<html>
<head>
<script type="text/javascript" src="http://www.peterbailey.net/dhtml/js/date.class.js"></script>
<script type="text/javascript" src="http://www.peterbailey.net/dhtml/js/timer.class.js"></script>
<script type="text/javascript">
function init()
{
var a = new DateStamp( 'ds1', 'l jS of F Y h:i:s A', 1000 );
var b = new DateStamp( 'ds2', 'D M j G:i:s Y', 1000 );
var c = new DateStamp( 'ds3', 'm/d/y G:i a', 60000 );
}
function DateStamp( oId, dateFormat, interval )
{
this.elem = document.getElementById( oId );
this.format = dateFormat;
this.timer = new Timer( this );
this.interval = this.timer.setInterval( "update", interval )
this.update()
}
DateStamp.prototype.update = function()
{
this.elem.innerText = new MyDate().getDate( this.format );
}
</script>
</head>
<body onload="init()">
<div id="ds1"></div>
<div id="ds2"></div>
<div id="ds3"></div>
</body>
</html>
Of course, when you use these, I'd ask that you download and host the Date class and the Timer class yourself, and not leech them from me :thumbsup:
cg9com
03-13-2003, 04:20 PM
this is my date script, it took me eleventy-seven years to make.
<script type="text/javascript">
document.write(Date());
</script>
:D :D :D
beetle
03-13-2003, 04:28 PM
Originally posted by cg9com
this is my date script, it took me eleventy-seven years to make. LOL :D
beetle
03-13-2003, 08:20 PM
Originally posted by xlee
<script>
<!--//hide
document.write(document.lastModified);
//end hide-->
</script> Not only is document.lastModified unreliable, but that's not what Subir is even asking for.
cg9com
03-14-2003, 05:53 AM
beetle are you seeing things again? take your medicine. :D :D
beetle
03-14-2003, 01:31 PM
Hehe, no! it looks like xlee deleted his/her post!
hmmmm
Tails
03-14-2003, 07:57 PM
How does someone delete their post? (probably dumb question, but I'll try it on this message lol)
beetle
03-14-2003, 08:48 PM
If you 'edit' within the first minute or so, you have the option (at the top) to delete it.
cg9com
03-15-2003, 06:56 AM
Originally posted by beetle
If you 'edit' within the first minute or so
i think you can do it anytime, i just tested on a previous post in this thread, it gave the option.
StefanH
09-22-2004, 04:38 PM
Hello,
I was wondering if there is an option (and how) to have a time stamp for every desired link on a page?
Something that would like this:
Home Page contains:
Link 1 (Newspage1.html)
Last updated MMMM, DD YYYY - HH:MM
Link 2 (Newspage2.html)
Last updated MMMM, DD YYYY - HH:MM
Link 3 (Newspage3.html)
Last updated MMMM, DD YYYY - HH:MM
Link 4 (Other.html) [no time stamp]
Link 5 (Newspage4.html)
Last updated MMMM, DD YYYY - HH:MM
I noticed some codes in this thread but I dont know if they can be altered to insert the dates/times of when the target pages were updated (saved) last. Also, how could the font, size, color (if desired) be changed on the time stamps?
Thank you for your time.
StefanH
p.s.
If this should be moved to its own thread, please feel free to do so.
----------------
Originally posted by xlee
<script>
<!--//hide
document.write(document.lastModified);
//end hide-->
</script>
----------------
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.