public static String convertLongToDate(
      long timestamp, final String sourcePrecision, final ZoneId zoneId) {
    switch (sourcePrecision) {
      case "ns":
      case "nanosecond":
        timestamp /= 1000_000;
        break;
      case "us":
      case "microsecond":
        timestamp /= 1000;
        break;
      default:
        break;
    }
    return LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), zoneId).toString();
  }
convert duration string to millisecond, microsecond or nanosecond.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/DateTimeUtils.java