Comment #8 on issue 2400 by mePoorGamer: document.lastModified must
return "01/01/1970 00:00:00" if Last-Modified header is missing or null.
http://code.google.com/p/chromium/issues/detail?id=2400
<script language="JavaScript">
<!--
// This is my current workaround:
// to replace document.lastModified - for use with Chrome, FF, & IE
// returns lastModified dateTime of the document, or if unknown the current
dateTime
function grab_lastModified() {
function zeroPadding(numberToPad,digitWidth) {
var result = numberToPad + "";
while(result.length < digitWidth) {
result = "0" + result;
}
return result;
}
if(document.lastModified!="" || document.lastModified=="01/01/1970
00:00:00")
{
return document.lastModified;
}
var d = new Date();
var curMonth = d.getMonth();
var curDay = d.getDate();
var curYear = d.getFullYear();
var curHour = d.getHours();
var curMin = d.getMinutes();
var curSec = d.getSeconds();
var cur_dateTime = zeroPadding(curMonth+1,2) + "/" +
zeroPadding(curDay,2)
+
"/" +
zeroPadding(curYear,4) + " " + zeroPadding(curHour,2) + ":" +
zeroPadding(curMin,2) +
":" +
zeroPadding(curSec,2);
return cur_dateTime;
}
//-->
</script>
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---