Click to See Complete Forum and Search --> : Document modified Netscape Browser Native Date


ikiani
November 1st, 2002, 06:54 PM
After I update my html files, browser displays last modified date. I am tring to get Netscape browser native date displays as

December 31, 1999

instead of

Friday, December 31, 1999 07:04:34

The above format is through Netscape 4.7-6.0, Its different on 7.0, Do NOT try it on Netscape 7.0
all the other version of IE and netscape are working fine.

Help appreciated.
Thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body>
<script language = "JavaScript">
<!--
var messege=document.lastModified;
document.write(location.hostname+"<br>")
window.defaultStatus=Math.PI;
if (navigator.appName.substring(0,8) == "Netscape")
{
if (navigator.appVersion.substring(0,3) >=4.5)
// Display date for new Netscape version
// var words=messege.split(",");
// words.sort();
// for (i=0; i < words.length; i++)
// document.write(words + "<br>");
document.write(document.lastModified.substring(0,12)+"<br>"+document.lastModified+"<br>"+messege.toUpperCase());
else
// display date for old Netscape versions
document.write(document.lastModified.substring(0,8));
}
else
{
// if {put test for new IE versions here)
if (navigator.appName == "Microsoft Internet Explorer")
// display date for new IE versions
document.write(document.lastModified.substring(0,10)+"<br>"+document.lastModified);
else
// display date for old IE versions
document.write(document.lastModified.substring(0,8));
}
//-->
</script>
<br>
</body>
</html>

websmith99
November 4th, 2002, 04:01 PM
This works for Netscape 4.7 - Netscape 6.2

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
</head>
<body>
<script language = "JavaScript">
<!--
var messege=document.lastModified;
document.write(location.hostname+"<br>")
window.defaultStatus=Math.PI;
if (navigator.appName.substring(0,8) == "Netscape"){
if (navigator.appVersion.substring(0,3) >=4.5) {
words=messege.split(",");
year=words[2].split(" ");
document.write(words[1]+ ", " + year[1] + "<br>");
} else {
document.write(document.lastModified.substring(0,8));
}
} else {
// if {put test for new IE versions here)
if (navigator.appName == "Microsoft Internet Explorer")
// display date for new IE versions
document.write(document.lastModified.substring(0,10)+"<br>"+document.lastModified);
else
// display date for old IE versions
document.write(document.lastModified.substring(0,8));
}
//-->
</script>
<br>
</body>
</html>

ikiani
November 4th, 2002, 06:58 PM
Thanks very much 4 your help. I have got it done.


<script language = "JavaScript">
<!--
var messege=document.lastModified;

var beg=(messege.indexOf(" "));

var end=(messege.lastIndexOf(" "));

if (navigator.appName.substring(0,8) == "Netscape")
{
if (navigator.appVersion.substring(0,3) >=4.5)
// Display date for new Netscape version
document.write(messege.substring(beg,end));
else
// display date for old Netscape versions
document.write(document.lastModified.substring(0,8));
}
else
{
// if {put test for new IE versions here)
if (navigator.appName == "Microsoft Internet Explorer")
// display date for new IE versions
document.write(document.lastModified.substring(0,10));
else
// display date for old IE versions
document.write(document.lastModified.substring(0,8));
}
//-->
</script>
<noscript>
<b>Please>/b> try this page for browsers that can not handle SCRIPTing.
<a HREF="http://www.netscape.com/">Upgrade Browser</a>
</noscript>