Getting the TimeZone Name

May 10, 2004
coldfusion

CFML's function GetTimeZoneInfo will give you timezone offsets, and day light savings time information, but if you want the name of the timezone your ColdFusion server is in you can use java's TimeZone class:

<cfset tz = CreateObject("java", "java.util.TimeZone")>
<cfset tz = tz.getDefault()>
<cfoutput>TimeZone: #tz.getDisplayName()# (#tz.getID()#)</cfoutput>

The output when I run it is:

TimeZone: Eastern Standard Time (America/New_York) 

3 people found this page useful, what do you think?

Comments

you might find this thing useful: http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn130#loc=en_us&view=sn106&viewName=Exchange%20Search%20Details&authorid=30822818&page=0&scrollPos=0&subcatid=0&snid=sn106&itemnumber=6&extid=1007983&catid=0
Any idea how to (easily) find the abbreviations for the timezones... i.e. "CST" or "PST"?
You may also want to find another surgeon to get a second opinion, to confirm if surgery is the right treatment for you. ,


foundeo