September 06, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
Help! Can't I set a specific time zone for a ColdFusion App? [heur SPAMTRAP]
Bob Wright wrote:Paul Hastings 05/12/08 07:15 P Bobby Hartsfield wrote:Paul Hastings 05/12/08 07:33 P Storing the offset in a variable makes it easy to change globally.Bobby Hartsfield 05/12/08 07:48 P Bobby Hartsfield wrote:Paul Hastings 05/12/08 07:56 P > it was a rhetorical question ;-)Bobby Hartsfield 05/12/08 08:04 P When applying a bandage over a 'wound' (beware, analogy here), you must beWilliam Seiter 05/12/08 10:00 P If you know of a bandage that doesn't need changing, please do share.Bobby Hartsfield 05/13/08 07:39 A 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.Bob Wright 05/13/08 12:55 P If you are getting the offset from the gettimezoneinfo(), that is theBobby Hartsfield 05/13/08 02:22 P 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 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? 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? 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. > 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. 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? :: :: :: 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? :: :: :: 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 ----- 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 ----- 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 -----
|
Mailing Lists
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||