简体   繁体   中英

Orion Context Broker Timezone

我所有实体的时区均设置为:“ timezone”:“ Europe / Rome”,但是TimeInstant报告延迟2小时。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM