Hello
How do I get the timezone information of the client using Xform. I need to get the timezone information or the GMT offset information. Is there a way to get it ?
Please let me know.
|
|
TimeZone information
Submitted by abb on Tue, 2007-12-04 01:25.
Hello How do I get the timezone information of the client using Xform. I need to get the timezone information or the GMT offset information. Is there a way to get it ? Please let me know. |
Have you looked at the
Have you looked at the xforms 1.1 date and time functions? .
The local-dateTime() function looks to return the information you require. If you need to be able to access this information in formsPlayer 1.4 version then you can always use some javascript, along the lines of:
... function show_date_time_offset() { var d = new Date(); var tz_offset_mins = d.getTimezoneOffset(); alert("Difference in hours between local time and GMT: " + (tz_offset_mins / 60)); return (tz_offset_mins / 60); } ...You can then call the script (one way of doing so) with an xf:trigger that uses xf:setvalue.
If you choose to use the javascript solution, you'll need to also have included the inline script namespace on your forms HTML element, like:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:js="http://www.formsplayer.com/inlineScript" ... >