House of Fusion
Home of the ColdFusion Community
Hostmysite VPS Hosting

Search cf-talk

September 06, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30         

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Help! Can't I set a specific time zone for a ColdFusion App? [heur SPAMTRAP]

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Hastings
05/12/2008 07:15 PM

Bob Wright wrote: > Isn't there some way to easily change the time zone of a particular > application - like in the <cfapplication> or something?  Surely I can't be > the first person to deal with this problem!  There must be an easy fix yes? timezone CFC: http://www.sustainablegis.com/projects/tz/testTZCFC.cfm a cautionary tale about tz & cf: http://www.sustainablegis.com/blog/cfg11n/index.cfm?mode=entry&entry=77223B6A-20ED-7DEE-2AB7FBB1F37ABD77 request this functionality in future versions of cf: http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=12&6213=6

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Hastings
05/12/2008 07:33 PM

Bobby Hartsfield wrote: > You could store the time offset within an application variable then use that > along with dateadd() within all of your dateformat and tiemformat calls > throughout the application. what about DST changes?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby Hartsfield
05/12/2008 07:48 PM

Storing the offset in a variable makes it easy to change globally. There is the isDTSOn value of the GetTimeZoneInfo() function as well but you could very well have some wrong times for a max of 5 hours depending on the two US locations if you decide to dynamically update the offset based on isDTSOn. That said, I would use the isDTSOn value to help decide the offset but I would update the offset manually. Using isDTSOn would really only be a backup plan in case you forget to update it yourself. I havent looked at the CFC you posted, does that cover DTS? If so it may be a simpler solution for now. You could also cfexecute time and change the time of the server ;-)... Ps ... that is a joke of course... don't get yourself kicked off your host .:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com SPAMTRAP] Bobby Hartsfield wrote: > You could store the time offset within an application variable then use that > along with dateadd() within all of your dateformat and tiemformat calls > throughout the application. what about DST changes?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Hastings
05/12/2008 07:56 PM

Bobby Hartsfield wrote: > Storing the offset in a variable makes it easy to change globally. it was a rhetorical question ;-) > There is the isDTSOn value of the GetTimeZoneInfo() function as well but you that's just for the server's tz--it's not a viable solution for a global app. > I havent looked at the CFC you posted, does that cover DTS? If so it may be > a simpler solution for now. yes it does but read the tz hell blog posting first.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby Hartsfield
05/12/2008 08:04 PM

> it was a rhetorical question ;-) Consider it retorted ;-) > that's just for the server's tz--it's not a viable solution for a global app. Nope, just a viable backup plan for the short term memory impaired. But I took 'mid-west' and 'east coast' as US locations when the OP mentioned them, which is why I only mentioned a 5 hour max offset for US locations ;-) I will deffinitely check out the CFC and the tz hell blog post since I want to add user defined timezones to CF4em soon as well. .:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com SPAMTRAP] Bobby Hartsfield wrote: > Storing the offset in a variable makes it easy to change globally. it was a rhetorical question ;-) > There is the isDTSOn value of the GetTimeZoneInfo() function as well but you that's just for the server's tz--it's not a viable solution for a global app. > I havent looked at the CFC you posted, does that cover DTS? If so it may be > a simpler solution for now. yes it does but read the tz hell blog posting first.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
William Seiter
05/12/2008 10:00 PM

When applying a bandage over a 'wound' (beware, analogy here), you must be prepared to need change the bandage from time to time.... ---------------------------------- William Seiter ColdFusion Web Developer / Consultant http://william.seiter.com Have you ever read a book that changed your life? Go to: http://www.winninginthemargins.com Use PassKey: GoldenGrove You'll be glad you did. ::-----Original Message----- :: ::Sent: Monday, May 12, 2008 4:32 PM ::To: CF-Talk ::Subject: Re: Help! Can't I set a specific time zone for a CF App? [heur ::SPAMTRAP] :: ::Bobby Hartsfield wrote: ::> You could store the time offset within an application variable then use ::that ::> along with dateadd() within all of your dateformat and tiemformat calls ::> throughout the application. :: ::what about DST changes? :: :: ::

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby Hartsfield
05/13/2008 07:39 AM

If you know of a bandage that doesn't need changing, please do share. .:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com SPAMTRAP] When applying a bandage over a 'wound' (beware, analogy here), you must be prepared to need change the bandage from time to time.... ---------------------------------- William Seiter ColdFusion Web Developer / Consultant http://william.seiter.com Have you ever read a book that changed your life? Go to: http://www.winninginthemargins.com Use PassKey: GoldenGrove You'll be glad you did. ::-----Original Message----- :: ::Sent: Monday, May 12, 2008 4:32 PM ::To: CF-Talk ::Subject: Re: Help! Can't I set a specific time zone for a CF App? [heur ::SPAMTRAP] :: ::Bobby Hartsfield wrote: ::> You could store the time offset within an application variable then use ::that ::> along with dateadd() within all of your dateformat and tiemformat calls ::> throughout the application. :: ::what about DST changes? :: :: ::

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bob Wright
05/13/2008 12:55 PM

Thanks to all for the replies. It really shockes me that a simple mechanism to change the timezone of a particular app was never added to CF.  I'm sure this has been a problem for many over the years. Dave pointed me to a simple UDF that did the trick.  Thanks Dave! Regarding the question about remembering to change the offset when we go back to standard time, I don't  think this that is an issue, is it?  As long as timeZoneInfo.UTCtotalOffset increments to reflect the new offset, I can just use Application.TimeZone = -(timeZoneInfo.utcHourOffset+1) right? Again, thanks all for your replies.   Bob ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bobby Hartsfield
05/13/2008 02:22 PM

If you are getting the offset from the gettimezoneinfo(), that is the servers offset, not the remote locations offset. .:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com SPAMTRAP] Thanks to all for the replies. It really shockes me that a simple mechanism to change the timezone of a particular app was never added to CF.  I'm sure this has been a problem for many over the years. Dave pointed me to a simple UDF that did the trick.  Thanks Dave! Regarding the question about remembering to change the offset when we go back to standard time, I don't  think this that is an issue, is it?  As long as timeZoneInfo.UTCtotalOffset increments to reflect the new offset, I can just use Application.TimeZone = -(timeZoneInfo.utcHourOffset+1) right? Again, thanks all for your replies.   Bob ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bob Wright
05/13/2008 02:45 PM

Right: east coast server's offset of 4+1 = 5, the offset for the mid-west client. Well, actually it's -5, but you get the point. :) ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists