User Guide
244 Developing Web Applications with ColdFusion
All of Allaire’s WDDX serializers (CFML, COM, and JS) have an attribute/property
useTimezoneInfo that specifies whether time zone information should be used in the
serialization process. The default value is true.
In the CFML implementation, useTimezoneInfo is a property of the CFWDDX
Action=Cfml2WDDX tag. In the COM implementation,
useTimezoneInfo is a property
of the IWDDXSerializer interface provided by the object
WDDX.Serializer.1. In the JS
implementation
useTimezoneInfo (note the case-sensitivity of JS) is a property of the
WDDXSerializer object.
Date-time values in WDDX are represented using a subset of the ISO8601 format. Time
zone information is represented as an hour/minute offset from UTC, for example,
"1998-9-8T12:6:26-4:0".
During WDDX deserialization to CFML and COM time zone information is
automatically taken into account and all date-time values are converted to local time.
In this way, UTC is taken out of the picture entirely and developers do not need to
worry about the details of time zone conversions.
However, during deserialization to JavaScript expressions, time zone information is
not taken into account. Complications arise because of the difficulty of knowing the
time zone of the browser.
How WDDX Works
The WDDX vocabulary describes a data object with a high level of abstraction. For
instance, a simple object with two string properties might take the following form after
it is serialized into a WDDX XML representation for delivery via HTTP:
<var name=’x’>
<struct>
<var name=’a’>
<string>Property a</string>
</var>
<var name=’b’>
<string>Property b</string>
</var>
</struct>
</var>
The deserialization of this XML by the WDDX Deserializer object would create a
structure similar to what would be created directly by this JavaScript object
declaration: