jixuan1989 commented on a change in pull request #1290:
URL: https://github.com/apache/incubator-iotdb/pull/1290#discussion_r432935634



##########
File path: 
server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
##########
@@ -1475,7 +1475,15 @@ long parseTimeFormat(String timestampStr) throws 
SQLParserException {
       throw new SQLParserException("input timestamp cannot be empty");
     }
     if (timestampStr.equalsIgnoreCase(SQLConstant.NOW_FUNC)) {
-      return System.currentTimeMillis();
+      String timePrecision = 
IoTDBDescriptor.getInstance().getConfig().getTimestampPrecision();
+      switch (timePrecision) {
+        case "ns":
+          return System.currentTimeMillis() * 1000_000L;

Review comment:
       I think `Instant.now()` is a good solution. 
   Another way is just using the last 6 digits of System.nanoTime(), as in a 
JVM instance (which means if you do not restart the JVM), System.nanoTime() is 
keeping increasing.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to