Closed Thread Icon

Preserved Topic: HELP!!! Last updated date gone wrong??? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=15672" title="Pages that link to Preserved Topic: HELP!!! Last updated date gone wrong??? (Page 1 of 1)" rel="nofollow" >Preserved Topic: HELP!!! Last updated date gone wrong??? <span class="small">(Page 1 of 1)</span>\

 
TheTrixter
Bipolar (III) Inmate

From: Derbyshire, UK
Insane since: Jul 2000

posted posted 01-16-2001 17:55

Can anyone shed any light on this. I got some excellent help from Mr Max and others in the HTML forum about a last updated javascript routine, which I got to work great.
Now the other day, my PC clock decided to reset. No problem I thought, must just be the battery thats gone, so I bought a new one and installed it and reset the clock.
Now for some reason, even though when I look at the properties of a html file and get the last updated date correctly as 16-01-01, the javascript routine insists that it was last updated on 02-01-01.
Is there something else I have to do when installnig a new battery???????

Hope you can help.

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 01-16-2001 18:55

Hmm, I really have no idea what's wrong with your clock, but did you set it up correctly in BIOS? On some occasions when replacing battery you also have to reset BIOS to factory default setting and set-it up again as it was before reset (BTW You should write down settings before resetting), but I won't suggest that you do this. Anyway, if the last modified date JavaScript works fine on the server, I wouldn't pay much attention on the wrong date that gets displayed locally...



[This message has been edited by mr.maX (edited 01-16-2001).]

Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 01-16-2001 20:14

Once it happened to me, but it seems that some bateries can damage the circuits when they get wet.
Check around the battery place on you mother board.

TheTrixter
Bipolar (III) Inmate

From: Derbyshire, UK
Insane since: Jul 2000

posted posted 01-16-2001 20:46

Stranger and stranger . . . . . .

When I use Mr Maxs code it comes up with the wronf date, it started two days ago, displaying "00 Jan 2001" and now it shows "02 Jan 2001" Here is the code :-

<script type="text/javascript" language="JavaScript">
<!-- ;

function LZ(number) {
if (number < 10) {
return '0'+number;
} else {
return number;
}
}

lastmoddate = new Date;
lastmoddate.setTime(Date.parse(document.lastModified));

if (lastmoddate != 0) {
day = LZ(lastmoddate.getDay());

// Use this if you want to get only month number
// month = LZ(lastmoddate.getMonth()+1);

// Use this if you want to get month name instead of number
monthNames = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
month = monthNames[lastmoddate.getMonth()];

year = lastmoddate.getYear();
hours = LZ(lastmoddate.getHours());
minutes = LZ(lastmoddate.getMinutes());
document.writeln("This page was last modified on: " + day + " " + month + " " + year + " at " + hours + ":" + minutes);
}
// -->
</script>


I thought I'd just try it again with Docs code to see if I had a problem with my clock, and low and behold, his works (all be it in the wrong format but it still picks up the correct date, the 16th).

Here is the Docs code

<SCRIPT LANGUAGE = "JavaScript">
//This script courtesy of Doc Ozone. Feel free to borrow, but leave credit in scource.//
<!-- begin date and time script
document.write("<font size=-1>- The current date & time is ")
document.write(Date())
document.write("-<br>- This page last modified ")
document.write(document.lastModified)
document.write(" -</font><br>")
</SCRIPT>


That is so odd . . . . .


TheTrixter
Bipolar (III) Inmate

From: Derbyshire, UK
Insane since: Jul 2000

posted posted 01-23-2001 19:36

Ha ha ha ha, I've solved the problem. It wasn't anything to do with my clock. There was a small error in Mr Maxs code. I think the following line was incorrect:-
day = LZ(lastmoddate.getDay());

It was picking the up the day number (ie mon=1 tue=2 wed=3 etc) instead of the Date(eg 23rd)

I changed it to read getDate and it worked perfectly.

Phew, that was really beginning to piss me off, but now it's solved. Thanks once again for the code Mr Max.



mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 01-23-2001 22:03

Ahhh, stupid typo... Anyway, I'm glad that you've solved it!



[This message has been edited by mr.maX (edited 01-23-2001).]

« BackwardsOnwards »

Show Forum Drop Down Menu