pf » Getting the TimeZone Name
May 10, 2004
Getting the TimeZone Name
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)
Trackback Address: 132/A940471F18A79C5BB7709BDE5A07FA4C
Comments
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
- Mastering CFQUERYPARAM
- Google Code Search for ColdFusion
- Speaking at CFUNITED 2008
- Getting ColdFusion SQL Statements from SQL Server Trace
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
Subscribe to my RSS Feed:
RSS
RSS
add to del.icio.us
Pete Freitag is a software engineer, and web developer located in











