How to Change Server Current Time to Indian Standar Time Zone?

To see the current server time: http://bethelwebhost.com/time.shtml  ( Set for Central US time - CST)

If you want to override this time zone setting, to IST time zone, follow these instruction.

1. Login to cPanel

2. Open Legacy File Manager > public_html >

3. Create a new file called php.ini  (if already created edit it)

4. Add following code

date.timezone =Asia/Kolkata

5. Save php.ini file

To Test the Current Changed Time Zone, follow this instruction.

1. Create new file called time.php

3. copy / paste below code

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Time</title>
</head>

<body>
<script type="text/javascript">

var currenttime = '<? print date("F d, Y H:i:s", time())?>' //PHP method of getting server date

///////////Stop editting here/////////////////////////////////

var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
var serverdate=new Date(currenttime)

function padlength(what){
var output=(what.toString().length==1)? "0"+what : what
return output
}

function displaytime(){
serverdate.setSeconds(serverdate.getSeconds()+1)
var datestring=montharray[serverdate.getMonth()]+" "+padlength(serverdate.getDate())+", "+serverdate.getFullYear()
var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds())
document.getElementById("servertime").innerHTML=datestring+" "+timestring
}

window.onload=function(){
setInterval("displaytime()", 1000)
}

</script>

<p><b>Current Server Time:</b> <span id="servertime"></span></p>
</body>

</html>

4. Save the file time.php

5. Now view the file in browser: www.yourdomain.com/time.php

It should show the IST time. If you still have problem fixing the time zone, post a support ticket to Tech Department.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Change file/foldr Permission

All files on UNIX (including Linux and other UNIX variants) machines have access permissions....

Site Restore/ Backup Information

All Customer’s are requested to keep a FULL BACKUP of their site in local computer. Our...

How to Generate a Full Backup?

1. Login to your cPane 2. Under Files  click on "Backup" 3. Click on "Download or Generate...