How to Customize Local Time and Date in WebSitePanel

Applied on: Windows Hosting.

The server at (and for others too) shows date time as per their physical location. Many webmasters (like me), require date time value as per my own location. This ASP script will get the GMT date time value from the server and add 5 hours, as per my GMT change.


‘assigin gmt time difference with local to variable

my_gmt_diff = +5

‘ get current datetime of server

od = now()

‘server has location information so we get gmt time as per location

set oShell = CreateObject(“WScript.Shell”)

atb = “HKEY_LOCAL_MACHINE\System\CurrentControlSet\” &_


offsetMin = oShell.RegRead(atb)

nd = dateadd(“n”, offsetMin, od)

my_local_datetime    = dateadd(“h”,my_gmt_diff,nd) ‘ to save on database (mm/dd/yyyy)

Response.Write my_local_datetime


Hope this will helps people searching for such script.

Tags: , , , , , , , , , , | Posted under DotNet/Windows Hosting, Programming/Coding, Using Arvixe | RSS 2.0

2 Comments on How to Customize Local Time and Date in WebSitePanel

  1. Prakash says:

    Current UK time is British Summer Time (BST) which is one hour ahead of Other Countries. So this code wont work.

Leave a Reply

Your email address will not be published. Required fields are marked *