<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN"
"http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Get local time</title>
<script src="//code.jquery.com/jquery-1.10.2.js" language="javascript" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript"> function gettime() { var d = new Date(); document.getElementById("utctime").value= d; utc = d.getTime() + (d.getTimezoneOffset() * 60000); nd = new Date(utc + (3600000*+5.5)); var ist = nd.toLocaleString(); document.getElementById("localtime").value=ist; } </script>
</head>
<body onload="gettime()"> UTC time :
<input type="text" id="utctime" />
<br/>
<br/> Local time :
<input type="text" id="localtime" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN"
"http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Get local time</title>
<script src="//code.jquery.com/jquery-1.10.2.js" language="javascript" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript"> function gettime() { var d = new Date(); document.getElementById("utctime").value= d; utc = d.getTime() + (d.getTimezoneOffset() * 60000); nd = new Date(utc + (3600000*+5.5)); var ist = nd.toLocaleString(); document.getElementById("localtime").value=ist; } </script>
</head>
<body onload="gettime()"> UTC time :
<input type="text" id="utctime" />
<br/>
<br/> Local time :
<input type="text" id="localtime" />
</body>
</html>This code snippet for Convert UTC time to local time.