简体   繁体   English

将RFC3339标准时间传递给InfluxDB,导致错误结果

[英]Passing RFC3339 standard time to InfluxDB, resulting in wrong results

I am trying to populate data into InfluxDB using Python. 我正在尝试使用Python将数据填充到InfluxDB中。 My RFC 3339 timestamp is "2016-01-11T01:07:39+05:30". 我的RFC 3339时间戳是“ 2016-01-11T01:07:39 + 05:30”。 When I try to pass this to InfluxDB, it returns a time of: "2016-01-10T19:37:39Z", while I actually want the time in InfluxDB to be "2016-01-11T01:07:39". 当我尝试将其传递给InfluxDB时,它返回一个时间:“ 2016-01-10T19:37:39Z”,而我实际上希望InfluxDB中的时间为“ 2016-01-11T01:07:39”。 I have even tried to pass only "2016-01-11T01:07:39" leaving "+5:30", but still it gives me no result. 我什至尝试仅通过“ 2016-01-11T01:07:39”,而保留“ +5:30”,但仍然没有任何结果。 What mistake am I making? 我犯什么错误?

InfluxDB converts all timestamps to UTC for storage. InfluxDB将所有时间戳转换为UTC进行存储。 2016-01-11T01:07:39+05:30 is 2016-01-10T19:37:39Z (the Z indicates UTC). 2016-01-11T01:07:39+05:302016-01-10T19:37:39ZZ表示UTC)。 I'm not sure why that seems incorrect to you. 我不确定为什么这对您来说不正确。

To store 2016-01-11T01:07:39 , you must submit the full RFC3339 UTC timestamp 2016-01-11T01:07:39Z , which includes the mandatory Z . 要存储2016-01-11T01:07:39 ,您必须提交完整的RFC3339 UTC时间戳记2016-01-11T01:07:39Z ,其中包括必需的Z

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

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