Re: The GetTimeZoneInfo() function
Gerald, I've solved the problem, thank you though. Best, Don >Don, >I will get with you on this tomorrow. Our requirements were very different, >but I know more than I want to on the matter of syncing time zones, server >time, local times and JS. > >Regards >Gerald > >On Wed, Feb 20, 2008 at 4:45 PM, D > >> ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299555 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: The GetTimeZoneInfo() function
How interesting! Late this afternoon I "played" around your initial js code for tz, I attempted to send this js tz value to a form hidden field, then, have another js function to auto submit the form, then, have cf get its value, within the same template, tried it for about 15/20 minutes to no avail. I switched to sql to solve the problem. Thanks though. >To get the time information from Javascript into Cf, you would need to run a >javascript that will send the time information as either a url var or a form >var to a page on the server that will save it as a variable. > >The 'next' page will have that information available to it, but the page you >just ran will not. > >Eg. > >Run index.cfm page. > =contains > > var thistime = new Date(); > var req; > req = false; >if(window.XMLHttpRequest && !(window.ActiveXObject)) { > try { > req = new XMLHttpRequest(); >} catch(e) { > req = false; >} >} else if(window.ActiveXObject) { > try { > req = new ActiveXObject("Msxml2.XMLHTTP"); > } catch(e) { > try { > req = new ActiveXObject("Microsoft.XMLHTTP"); > } catch(e) { > req = false; > } > } >} > if(req) { > req.onreadystatechange = processReqChange; > req.open("POST","http://[servername]/[pagename.cfm]";, true); >req.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); > req.send("time=" + thistime); > } >} > > > >Or something like that. > >William >-- >William E. Seiter > >Have you ever read a book that changed your life? >Go to: www.winninginthemargins.com >Enter passkey: goldengrove > >Web Developer / ColdFusion Programmer >http://William.Seiter.com you *cannot* get the client's tz via js. >> >>Really? I just did. > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299554 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: The GetTimeZoneInfo() function
To get the time information from Javascript into Cf, you would need to run a javascript that will send the time information as either a url var or a form var to a page on the server that will save it as a variable. The 'next' page will have that information available to it, but the page you just ran will not. Eg. Run index.cfm page. =contains var thistime = new Date(); var req; req = false; if(window.XMLHttpRequest && !(window.ActiveXObject)) { try { req = new XMLHttpRequest(); } catch(e) { req = false; } } else if(window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } } } if(req) { req.onreadystatechange = processReqChange; req.open("POST","<a rel="nofollow" href="http://[servername]/[pagename.cfm]"">http://[servername]/[pagename.cfm]"</a>;, true); req.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); req.send("time=" + thistime); } } Or something like that. William -- William E. Seiter Have you ever read a book that changed your life? Go to: www.winninginthemargins.com Enter passkey: goldengrove Web Developer / ColdFusion Programmer http://William.Seiter.com -Original Message- From: Don L [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 20, 2008 1:46 PM To: CF-Talk Subject: Re: The GetTimeZoneInfo() function >>>you *cannot* get the client's tz via js. > >Really? I just did. I'm interested. William Seiter's js code works fine, but don't know how to convert js var into CF var (key to this thing). thanks. Don ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299553 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: The GetTimeZoneInfo() function
Don, I will get with you on this tomorrow. Our requirements were very different, but I know more than I want to on the matter of syncing time zones, server time, local times and JS. Regards Gerald On Wed, Feb 20, 2008 at 4:45 PM, Don L <[EMAIL PROTECTED]> wrote: > >>>you *cannot* get the client's tz via js. > > > >Really? I just did. > > I'm interested. William Seiter's js code works fine, but don't know how > to convert js var into CF var (key to this thing). thanks. Don > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299551 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The GetTimeZoneInfo() function
>>>you *cannot* get the client's tz via js. > >Really? I just did. I'm interested. William Seiter's js code works fine, but don't know how to convert js var into CF var (key to this thing). thanks. Don ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299525 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The GetTimeZoneInfo() function
>>you *cannot* get the client's tz via js. Really? I just did. If anyone wants the java script to pull the timezone from FF and IE and put it in a form field let me know. On Feb 19, 2008 8:46 PM, Paul Hastings <[EMAIL PROTECTED]> wrote: > William Seiter wrote: > > I believe you can use JS to pull the local computer's time and then use > AJAX > > you *cannot* get the client's tz via js. > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299401 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The GetTimeZoneInfo() function
William Seiter wrote: > That is correct, the querant only asked about timezone, however, if we limit > our responses to just 'what the querant asked about' there may be a world of the "querant"? what are we tarot card readers (and yes, had to look that word up)? > I get this result in FF: > Tue Feb 19 2008 20:11:51 GMT-0800 (Pacific Standard Time) thanks. thats interesting to know, i haven't really looked back at js since flex came out. in any case while that appears to be a valid long tz ID for where you are, it's not for where i am (bangkok): "Wed Feb 20 2008 11:47:43 GMT+0700 (SE Asia Standard Time)". it should be either "Asia/Bangkok" or "ICT" or "Indochina Time" depending on the JDK version. i suppose some finagling could produce a valid java tz but wonder if this will work across browsers/versions? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299391 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The GetTimeZoneInfo() function
That's neat, it also works with IE7. Now, I'm a bit scare of script kitty, not this one or the like. >That is correct, the querant only asked about timezone, however, if we limit >our responses to just 'what the querant asked about' there may be a world of >solutions that the querant had not even anticipated, hence the further >reference I had made to find out what the need was for. > >As for timezone... > >When I do this line of code: >var currentTime = new Date();document.getElementById('writedate').innerHTML >= currentTime; > >I get this result in FF: >Tue Feb 19 2008 20:11:51 GMT-0800 (Pacific Standard Time) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299390 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: The GetTimeZoneInfo() function
That is correct, the querant only asked about timezone, however, if we limit our responses to just 'what the querant asked about' there may be a world of solutions that the querant had not even anticipated, hence the further reference I had made to find out what the need was for. As for timezone... When I do this line of code: var currentTime = new Date();document.getElementById('writedate').innerHTML = currentTime; I get this result in FF: Tue Feb 19 2008 20:11:51 GMT-0800 (Pacific Standard Time) That appears to contain a timezone reference both by name and by GMT count. William -- William E. Seiter Have you ever read a book that changed your life? Go to: www.winninginthemargins.com Enter passkey: goldengrove Web Developer / ColdFusion Programmer http://William.Seiter.com -Original Message- From: Paul Hastings [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 7:31 PM To: CF-Talk Subject: Re: The GetTimeZoneInfo() function William Seiter wrote: > Not timezone, time. the original question was about timezone, not time. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299385 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: The GetTimeZoneInfo() function
William Seiter wrote: > Not timezone, time. the original question was about timezone, not time. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299384 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: The GetTimeZoneInfo() function
Paul, Not timezone, time. -- William E. Seiter Have you ever read a book that changed your life? Go to: www.winninginthemargins.com Enter passkey: goldengrove Web Developer / ColdFusion Programmer http://William.Seiter.com -Original Message- From: Paul Hastings [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 5:47 PM To: CF-Talk Subject: Re: The GetTimeZoneInfo() function William Seiter wrote: > I believe you can use JS to pull the local computer's time and then use AJAX you *cannot* get the client's tz via js. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299383 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The GetTimeZoneInfo() function
Thank you both about the JS option, I looked into that as well... but I'll stick to my sql solution for it (it's working fine and seem efficient). The app is not pre-released yet but it's consumer-oriented, not exactly intended for int'l but more for N. America... >I believe you can use JS to pull the local computer's time and then use AJAX >to send that information back to the server, however if this is for a >security system or an application's vital information, a user can just >change their local date/time to overcome the system. > >If you tell us what the end use will be for the information we may be able >to guide you with more useable information. > >William > >-- >William E. Seiter > >Have you ever read a book that changed your life? >Go to: www.winninginthemargins.com >Enter passkey: goldengrove > >Web Developer / ColdFusion Programmer >http://William.Seiter.com ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299381 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: The GetTimeZoneInfo() function
William Seiter wrote: > I believe you can use JS to pull the local computer's time and then use AJAX you *cannot* get the client's tz via js. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299380 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: The GetTimeZoneInfo() function
I believe you can use JS to pull the local computer's time and then use AJAX to send that information back to the server, however if this is for a security system or an application's vital information, a user can just change their local date/time to overcome the system. If you tell us what the end use will be for the information we may be able to guide you with more useable information. William -- William E. Seiter Have you ever read a book that changed your life? Go to: www.winninginthemargins.com Enter passkey: goldengrove Web Developer / ColdFusion Programmer http://William.Seiter.com -Original Message- From: Paul Hastings [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 19, 2008 5:07 PM To: CF-Talk Subject: Re: The GetTimeZoneInfo() function Don L wrote: > Indeed, I missed it, thanks. But, I do know my server's timezone, what I'd like to know is user/UA 's timezone, currently I'm using sql to do that... other than asking them, you really can't. i think js only returns the offset (if your app is global this is kind of meaningless as there are plenty of tz w/the same offset but different DST, etc. rules). if you're using flash/flex raw, it's date strings can include the tz which you could parse out. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299379 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: The GetTimeZoneInfo() function
Don L wrote: > Indeed, I missed it, thanks. But, I do know my server's timezone, what I'd > like to know is user/UA 's timezone, currently I'm using sql to do that... other than asking them, you really can't. i think js only returns the offset (if your app is global this is kind of meaningless as there are plenty of tz w/the same offset but different DST, etc. rules). if you're using flash/flex raw, it's date strings can include the tz which you could parse out. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299376 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: The GetTimeZoneInfo() function
Indeed, I missed it, thanks. But, I do know my server's timezone, what I'd like to know is user/UA 's timezone, currently I'm using sql to do that... > >yes you're missing somethings, from the cf8 docs: > >Returns > >Structure that contains these elements and keys: > >* utcTotalOffset: offset of local time, in seconds, from UTC > o A plus sign indicates a time zone west of UTC (such as a zone in > North America) > o A minus sign indicates a time zone east of UTC (such as a zone in > Germany) > * utcHourOffset: offset, in hours of local time, from UTC > * utcMinuteOffset: offset, in minutes, beyond the hours offset. For North >America, this is 0. For countries that are not exactly on the hour offset, the >number is between 0 and 60. For example, standard time in Adelaide, Australia >is >offset 9 hours and 30 minutes from UTC. > * isDSTOn: True, if Daylight Savings Time (DST) is on in the host; False, >otherwise > >this is the *server* timezone, so if your server's in a tz west of UTC it will >always be positive. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299374 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: The GetTimeZoneInfo() function
Don L wrote: > Personally I didn't find this function of any use, it tells offset from GMT, > however, it does not indicate whether it's to the east (+) or to west (-). > Am I missing something here (yes I've checked the livedocs about it). yes you're missing somethings, from the cf8 docs: Returns Structure that contains these elements and keys: * utcTotalOffset: offset of local time, in seconds, from UTC o A plus sign indicates a time zone west of UTC (such as a zone in North America) o A minus sign indicates a time zone east of UTC (such as a zone in Germany) * utcHourOffset: offset, in hours of local time, from UTC * utcMinuteOffset: offset, in minutes, beyond the hours offset. For North America, this is 0. For countries that are not exactly on the hour offset, the number is between 0 and 60. For example, standard time in Adelaide, Australia is offset 9 hours and 30 minutes from UTC. * isDSTOn: True, if Daylight Savings Time (DST) is on in the host; False, otherwise this is the *server* timezone, so if your server's in a tz west of UTC it will always be positive. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299371 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
The GetTimeZoneInfo() function
Personally I didn't find this function of any use, it tells offset from GMT, however, it does not indicate whether it's to the east (+) or to west (-). Am I missing something here (yes I've checked the livedocs about it). Thks. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:299370 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4