简体   繁体   English

Orion Context Broker时区

[英]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 : NGSIv2实现DateTime属性类型,如NGSIv2规范文档的“特殊属性类型”所述:

DateTime: identifies dates, in ISO8601 format. DateTime:以ISO8601格式标识日期。 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. 目前,Orion不使用时区(在下一版本中可能会更改)。 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. 但是,请注意,Orion Context Broker并未对基于名称的属性提供特殊处理。 I mean, the name of the attribute could be TimeInstant or any other. 我的意思是,该属性的名称可以是TimeInstant或任何其他名称。

EDIT : Orion timezone support will improve in version 1.6.0. 编辑 :Orion时区支持将在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). 该版本将在创建/更新时支持时区解释(因此,您可以使用例如2017-06-17T07:21:24.238Z2017-06-17T08:21:24.238+0100表示相同)。 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. 但是,为了为客户从不同时区访问相同实体(如@LeonanCarvalho提到的)建立共同点,无论日期如何存储,日期时间检索都在UTC / Zulu中进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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