You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/05/27 09:28:31 UTC

[GitHub] [incubator-iotdb] jixuan1989 commented on issue #1276: 你好,请问现在iotdb的时间是精确到毫秒级吗 (What is the time precision unit of IoTDB? Can it be changed?)

jixuan1989 commented on issue #1276:
URL: https://github.com/apache/incubator-iotdb/issues/1276#issuecomment-634542829


   IoTDB默认使用毫秒, 但是其实IoTDB内部是用的long进行存储的,因此可以通过配置来支持微秒和纳秒。
   在IoTDB配置文件(iotdb-engine.properties)中的如下配置:
   ```
   # Use this value to set timestamp precision as "ms", "us" or "ns".
   # Once the precision is been set, it can not be changed.
   timestamp_precision=ms
   ```
   这样的话,你传入一个long时间戳,就会将其按照微秒或者纳秒解读了。
   不过目前的版本中 `now()`返回的是毫秒值, 所以如果将`timestamp_precision`设置为`us`或者`ns`,那么时间将来解析成人类可读的时间(yyyy-mm-dd HH:MM:ss)就会不太对。 这个会马上加PR修复。
   
   By default, IoTDB considers a long timestamp as millisecond time unit, but you can change it in iotdb-engine.properties: `timestamp_precision=us` or `timestamp_precision=ns`.
   
   But currently, `now()` function only returns `ms`.
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org