Hi Gav, There are anumber of techniques (HTML and Flash) but the method you choose will be determined by the flow of your site. Remember that the server version of the variable will not be available on the first time the cf template is invoked.
I don't have any Flash code examples but you could write a small Flash app that used Flash to remotly call a template to handle the client time. With the JS solution Have a look at "Passing a variable from JavaScript to server-side" (http://www.tek-tips.com/gviewthread.cfm/pid/216/qid/878609) To pass the JS var to CF you could put it in a form field and submit the form. Something like: <script> var currentUTCDate = new Date(); // creates a date in the form Wed Jul 14 09:58:44 UTC+0930 2004 document.DateForm.sDateUserUTC.value = currentUTCDate; document.DateForm.Submit(); </script> <form name="DateForm" target="hiddenFrame" action="catchDate.cfm" method="post"> <input name="sDateServer" type="Hidden" value="#Now()#"> <input name="sDateUserUTC" type="Hidden" value=""> </form> ... or create a URL with the date in the querystring and navigate to that URL: <script> var currentUTCDate = new Date(); // creates a date in the form Wed Jul 14 09:58:44 UTC+0930 2004 window.location = 'catchDate.cfm?utcdate=' + currentUTCDate; </script> Also you could try "Using a GIF as a Data Pipe" http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Essays/GIFAs Pipe/Index.cfm What are you planning to do with the client time variable once you catch it? cheers David -----Original Message----- From: Gavin Irons [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 14, 2004 1:51 PM To: CFAussie Mailing List Subject: [cfaussie] RE: Timezone function Hi David, Thanks for the script. However I battling to pass the JS var back to CF. Please can you "spell it out" as I have not had much experience with JS. Many thanks Gavin > Hi Gavin, > > What about a JavaScript along the lines of > > <script> > var currentUTCDate = new Date(); > // creates a date in the form Wed Jul 14 09:58:44 UTC+0930 2004 > //document.write(currentUTCDate); > </script> > > Then a method (hidden form etc) to pass the JS var currentUTCDate back to > CF? > > cheers > > David > > > -----Original Message----- > From: Gavin Irons [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 13, 2004 7:56 PM > To: CFAussie Mailing List > Subject: [cfaussie] Timezone function > > > Is there any way I can determine what timezone a user is in? > > Also can I get the time from the user's brower (ie not the server time). > > Thanks > > Gavin Irons > > > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to > [EMAIL PROTECTED] > Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
