IBM Support

Support time type

News


Abstract

Support time type

Content

 

What is it?

The integrated web services server now supports the xsd:time type.  In addition, problems with xsd:date and xsd:dateTime support has been corrected by the use of the new java.time classes introduced in Java 8. Starting November 2021, integrated web services PTFs produces Java code that requires the server to be using Java 8 or higher Java Runtime Environment (JRE).

The standard that is followed is ISO (international Organization for Standardization for representation of dates and times, and can be referenced by RFC 3339 (https://tools.ietf.org/html/rfc3339). To summarize:

DATE:

YYYY-MM-DD[Z|(+|-)hh:mm]

   Valid date values:
      1971-01-01
      1971-01-01Z
      1971-01-01+05:00

TIME:

hh:mm:ss[Z|(+|-)hh:mm]

   Valid time values:
      15:35:30
      15:35:30Z
      15:35:30-05:00

DATETIME:

YYYY-MM-DDThh:mm:ss.sss[Z|(+|-)hh:mm]

   Valid dateTime values:
      1971-01-01T15:35:30
      1971-01-01T15:35:30.123
      1971-01-01T15:35:30Z
      1971-01-01T15:35:30-05:00

Notes:

  1. If a time offset is specified on a date type, it is ignored.
  2. If a time offset is not specified on a time or dateTime type, the time or timestamp is assumed to be in the time zone of the server (local time). If you want to have time information that contains no time zone information to be assumed to be UTC time, add the following JVM property to integrated web services server JVM properties: -Dcom.ibm.iws.datetime.tz.utc=true
  3. The time and dateTIme values are normalized to the time zone of the server (local time).
  4. Fractional seconds are discarded for the time type.

If the web service is REST and the incoming data media type is not XML, a UNIX® timestamp can be specified.  A UNIX timestamp is just the number of milliseconds since 1 Jan 1970 00:00:00 (UTC). However, the recommendation is to human readable forms since it is more precise with less ambiguity.

The support provided by this PTF applies to web services running on version 2.6 or subsequent versions of the server.

Why use it?

For applications that want to use date/time/timestamps. Previously, the support for the date and dateTime types was inconsistent and allowed values that did not conform with the standards.  The new support for the date and dateTime types has been rewritten to ensure consistency and that the values conform with standards. 

Availability

The support is enabled in the following PTFs:
SI77513 V7R2M0
SI77512 V7R3M0
SI77511 V7R4M0

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"HW1A1","label":"IBM Power Systems"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
13 November 2021

UID

ibm11138630