Hi All,
i have changed my computer date from 8/2/2019 to 8/8/2019.
after changed the date then i try to login with my application from my local machine and i run the application in chrome browser but i can't able to login it just stay in the login page itself
even i reverted my computer date from 8/8/2019 to 8/2/2019 also but one think it is working fine with IE browser Not working with chrome or mozilla
So Currently my server time showing always 8/8/2019 in UI level (client side) but server side it showing currect date(today date).
So My question is How to fix date from wrong date to correct server date?
Do you have any idea for this?
var xmlHttp;
function srvTime(){
try {
//FF, Opera, Safari, Chrome
xmlHttp = new XMLHttpRequest();
}
catch (err1) {
//IE
try {
xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (err2) {
try {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (eerr3) {
//AJAX not supported, use CPU time.
alert("AJAX not supported");
}
}
}
xmlHttp.open('HEAD',window.location.href.toString(),false);
xmlHttp.setRequestHeader("Content-Type", "text/html");
xmlHttp.send('');
return xmlHttp.getResponseHeader("Date");
}
var st = srvTime();
var date = new Date(st);
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Server date/time</title>
<script language="javascript" src="serverDate.js"></script>
</head>
<script language="javascript">
var localTime = new Date();
document.write("Local machine time is: " + localTime + "<br>");
document.write("Server time is: " + date);
</script>
<body>
</body>
</html>