View Full Version: A request

All Mod GMC > InvisionFree Scripts > A request



Title: A request


King Elemento - January 18, 2007 06:29 PM (GMT)
Erm... I'd like a [now] tag, which replaces text saying [now] displays the date and time, and counts up in years, months, days, hours, minutes, seconds, and milliseconds*. If this can be done, excellent!

*Only prefered.

rig - January 18, 2007 10:57 PM (GMT)
Is it alright if i re-edit your re-edited code? :huh:

ari_aaron - January 19, 2007 02:11 AM (GMT)
He can't really give you permission, only James (who originally made it).

It is very simple, but my list of codes to make is currently to long to add any others to.

King Elemento - January 19, 2007 08:15 PM (GMT)
XD
Ok. Cool, sure.
I wish you COULD give me one though...
And I don't really want a box around it. Just plain text.

rig - January 20, 2007 03:13 AM (GMT)
QUOTE (ari_aaron @ Jan 18 2007, 09:11 PM)
He can't really give you permission, only James (who originally made it).

It is very simple, but my list of codes to make is currently to long to add any others to.

Lol... yeah you are right. Almost done with it right now and im probably gonna re-edit in a minute or so.

Edit: Hmm... Im not exactly sure on what you want so ill give you two srcripts. Also one might only work in IE. Try the bottom one. If the bottom one doesnt work for you try the top one. Personally, I never tested these :lol:

QUOTE
<script>
//TimeTag-Rig
now="[now]"
mydate= new Date()
theyear=mydate.getFullYear()
themonth=mydate.getMonth()+1
thetoday=mydate.getDate()
hour=mydate.getHours()+1
minute=mydate.getMinutes()
second=mydate.getSeconds()
thetime=hour+":"+minute+":"+second
iDiv=document.getElementsByTagName("DIV")
for(i=0;i<iDiv.length;i++){
for(n=0;n<100;n++){
if(iDiv[i].innerHTML.match(now) != null){
iDiv[i].innerHTML = iDiv[i].innerHTML.replace(now,thetoday+"/"+themonth+"/"+theyear+" "+thetime);
}
}
}
</script>


QUOTE
<div id="post">
[now]
</div>
<script>
//TimeTag-Rig
//V2 Test
now="[now]"
mydate= new Date()
theyear=mydate.getFullYear()
themonth=mydate.getMonth()+1
thetoday=mydate.getDate()
hour=mydate.getHours()+1
minute=mydate.getMinutes()
second=mydate.getSeconds()
thetime=hour+":"+minute+":"+second
thepost=document.getElementById('post')
if(thepost.innerHTML.match(now) != null){
thepost.innerHTML=thepost.innerHTML.replace(now,thetoday+"/"+themonth+"/"+theyear+" "+thetime);
}
</script>

King Elemento - January 20, 2007 12:35 PM (GMT)
I'll try them both, and I take it they go in the footers.

EDIT: It takes the page too long to load, and the second one doesn't work. Sorry.

rig - January 20, 2007 03:03 PM (GMT)
I might make there be a button instead of you typing the tag maybe... so you just press the button and it adds the current date for the second one. Im probably missing something thats obvious though.

ari_aaron - January 21, 2007 03:59 AM (GMT)
If you don't mind the output being like this:
QUOTE
Sat Jan 20 2007 22:56:35 GMT-0500 (Eastern Standard Time)


You can just use date()

fsd - January 21, 2007 02:01 PM (GMT)
i think he might want an updating date




Hosted for free by InvisionFree