lino prunella
lino prunella

Reputation: 11

Orion Context Broker Timezone

All my entities have time zone set to: "timezone": "Europe/Rome", but TimeInstant reports 2 hours delay.

Upvotes: 0

Views: 150

Answers (1)

fgalan
fgalan

Reputation: 12322

NGSIv2 implements the DateTime attribute type, as described in the "Special attribute types" of the NGSIv2 specification document:

DateTime: identifies dates, in ISO8601 format. These attributes can be used with the query operators greater-than, less-than, greater-or-equal, less-or-equal and range. For instance (only the referred entity attribute is shown):

  "timestamp": {
    "value": "2017-06-17T07:21:24.238Z",
    "type: "DateTime"
  }

At the present moment (it may change in a next version), Orion doesn't uses timezones. Thus, if your application needs it, your application should be the one implementing timezone-awareness.

However, note that Orion Context Broker doesn't provide special treatment to attributes based on name. I mean, the name of the attribute could be TimeInstant or any other.

EDIT: Orion timezone support will improve in version 1.6.0. That version will support timezone interpretation at creation/update time (so you can use for example 2017-06-17T07:21:24.238Z and 2017-06-17T08:21:24.238+0100 meaning the same). However, in order to set a common ground for clients accesing to the same entities from different timezones (as @LeonanCarvalho mentions) date time retrieval is in UTC/Zulu, no matter how it was stored.

Upvotes: 1

Related Questions