Time Zone

From Hostek.com Wiki
Jump to: navigation, search

Our servers are on Central Time Zone (timezone).

If you are in a different part of the country or world, you may want to adjust the time in your scripts. Below are a few example of how to do that.

ASP time change sample

Here is an ASP code example that subtracts 1 hour from the server time.

The time is <%=FormatDateTime(DateAdd("h",-1,Now),3)%>.

ColdFusion - Change display time - add 1 hour

The Hostek.com servers are based on Central Time. If you are in a different time zone, you may need to adjust the time that the server returns. Here is a sample line of code that will display the server time, plus 1 hour.

<CFOUTPUT>#TimeFormat(DateAdd("h", 1, Now()))#</CFOUTPUT>

If you need to subtract an hour you would do:

<CFOUTPUT>#TimeFormat(DateAdd("h", -1, Now()))#</CFOUTPUT>