Difference between revisions of "Time Zone"
From Hostek.com Wiki
(→ASP time change sample) |
|||
Line 13: | Line 13: | ||
[[Category:ASP.Net Tutorials]] | [[Category:ASP.Net Tutorials]] | ||
+ | |||
+ | ==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> | ||
+ | |||
+ | [[Category:ColdFusion Tips & Tricks]] |
Latest revision as of 12:43, 11 July 2013
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>