Using datetime formats

When dates and times are included in JSON and DSV data objects, you should define them as such in the object metadata. This makes it clear to applications that use the metadata that the values should be interpreted as dates or times. Infor applications that use dates and times must follow the ISO 8601 RFC 3339 standard formats.

JSON Schema draft-06 supports these date and time formats for string instances:

  • date-time
  • date
  • time

When you include dates and times in your objects, it is best practice to use “date-time”, in UTC, wherever possible. Dates without a time and times without a date regularly occur in application data. Therefore, you can also use the "date" or "time" formats alone.

Standard format definitions

This table shows the standard format definitions:

Metadata definition Expected format in data object Example data
“datetimeProperty”:{
	“type”:”string”,
	“format”:”date-time”
}
Note: Compass supports three fractional seconds.
yyyy-MM-ddTHH:mm:ss[.S]Z "2017-07-04T14:08:43Z"

Or

"2017-07-04T14:08:43.123Z"

“dateProperty”:{
	“type”:”string”,
	“format”:”date”
}
yyyy-MM-dd “2017-07-04”
“timeProperty”:{
	“type”:”string”,
	“format”:”time”
}

This format is not supported by Compass queries.

HH:mm:ss[.S] “14:08:43”

Or

“14:08:43.123”