pf » Getting the TimeZone Name

Getting the TimeZone Name

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) 

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

Trackback Address: 132/A940471F18A79C5BB7709BDE5A07FA4C
On 05/11/2004 at 1:45:22 AM MDT paulH wrote:
1
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

On 01/14/2006 at 4:01:00 PM MST Jake wrote:
2
Any idea how to (easily) find the abbreviations for the timezones... i.e. "CST" or "PST"?

On 04/19/2007 at 3:04:41 AM MDT Reinhard Jung wrote:
3
Hi Pete

very cool!!! I'll changed it a little and posted it on my own swiss blog. With a Link to your Entry, shurely.

You can see it here: http://www.landstrasse.ch/index.cfm/2007/4/19/TimeZone




  



Spell Checker by Foundeo





Subscribe to my RSS Feed: solosub RSS
Tags