How to Customize Local Time and Date in WebSitePanel

Applied on: Windows Hosting.

The server at arvixe.com (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\” &_

“Control\TimeZoneInformation\ActiveTimeBias”

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

Leave a Reply

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


7 × = 7

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>