ISO 8601 Date and Time Support
In previous releases, when a Date, Time, TimeStamp, or TimeStampOffset primitive type was returned from a web service, it was formatted in MicrosoftDateFormat, an old and long-deprecated format that many modern tools do not understand; for example, \\/Date(1488389116170-0500)\\/. To maintain existing behavior, you can still use the old MicrosoftDateFormat.
Jade 2022 now supports the ISO 8601 format, as specified in https://www.rfc-editor.org/rfc/rfc3339.
The use of ISO 8601 is enabled on the Define Application dialog for your REST web application by checking the new Use ISO 8601 Time check box on the Web Options sheet. This check box is unchecked by default. (This functionality is displayed on the Web Options sheet of the dialog only when the application selected in the Application Type list box on the Application sheet of this dialog is Rest Services or Rest Services, Non‑Gui.)
When the Use ISO 8601 Time check box is checked, the application formats all Date, Time, TimeStamp, and TimeStampOffset primitive types in ISO 8601 format rather than MicrosoftDateFormat.
In addition, when a TimeStamp is returned from the web service in ISO 8601 format, it includes time zone offset information, similar to a TimeStampOffset. This is required because the consumer of the web service would not otherwise know the time zone to which the TimeStamp is local. As such, all TimeStamp primitive types are converted to UTC time and an offset included that represents by how many hours and minutes to offset the TimeStamp to get to local time.
You can specify the time zone that should be assumed for TimeStamp primitive types by typing or selecting the appropriate time zone IANA name from the Timestamp TimeZone combo box on the Web Options sheet of the Define Application dialog. The combo box is populated with Etc/UTC (Z) as well as the time zone in which the database server is located. You can select any time zone you require, by typing it in full.
ISO 8601 with the JadeJson class
These changes are also applicable to the JadeJson class, which provides the following new properties and method to enable the new functionality.
-
useISO8601 property, which has a Boolean value. Set the property to true to use the ISO 8601 format instead of the MicrosoftDateFormat.
-
offsetForTimeStamps property, which has an Integer value. Set this property to the number of hours by which you want to offset TimeStamp values. Alternatively, you can set this from a time zone name by using the new setOffsetForTimeStamps method.
-
setOffsetForTimeStamps method, which enables you to specify the name of a time zone that can be the IANA or Windows name, and sets the offsetForTimeStamps property to the value of the offset of the specified time zone.