datetimeSerializationMode
Controls the JSON output format for DATETIME
values during serialization.
Syntax
datetimeSerializationMode = value
The value parameter is a STRING:
"FGL": Genero default format (default)"RFC3339/UTC": RFC 3339, normalized to UTC"RFC3339/TZO": RFC 3339, with the local time zone offset
The value names are the same as util.JSON.setDatetimeSerializationMode uses. The serializer matches them
case insensitively, and json.Serializer.getOption returns them in the spelling
of this list. The digits 0, 1, and 2 are also
accepted for "FGL", "RFC3339/UTC", and
"RFC3339/TZO".
A value that is not in this list raises error -15824.
datetimeSerializationMode is an optional option.
Usage
Use this option to control how DATETIME values are written to JSON. By default (value
"FGL"), the serializer writes DATETIME values in the Genero native
format. Set to "RFC3339/UTC" to write in RFC 3339 format normalized to UTC, or to
"RFC3339/TZO" to write in RFC 3339 format with the local time zone offset of the
server process.
When set to "RFC3339/TZO", the offset reflects the time zone of the server
process at runtime. The same DATETIME value can produce different output on servers
configured with different time zones.
For a description of the Genero native and RFC 3339 formats, go to BDL to JSON type conversion rules.
util.JSON. For equivalent behavior,
use util.JSON.setDatetimeSerializationMode.Affects
Serialization (BDL to JSON)
Example
To write DATETIME values in RFC 3339 format normalized to UTC:
CALL json.Serializer.setOption("datetimeSerializationMode", "RFC3339/UTC")
For a complete example, go to Serializing DATETIME and INTERVAL values in standard formats.