dzamo commented on a change in pull request #2284:
URL: https://github.com/apache/drill/pull/2284#discussion_r682270122



##########
File path: 
exec/vector/src/main/java/org/apache/drill/exec/vector/DateUtilities.java
##########
@@ -213,11 +216,27 @@ public static LocalDate fromDrillDate(long value) {
     return LocalDate.ofEpochDay(value / daysToStandardMillis);
   }
 
-  public static long toDrillTimestamp(Instant instant) {
-    return instant.toEpochMilli();
+  /**
+   * Convert to seconds since the _local_ Unix epoch, midnight 1970-01-01
+   * in the configured time zone.
+   * @param instant an Instant representing a moment in time.
+   * @param zoneId Drill's configured time zone.
+   * @return the Drill timestamp value corresponding to instant.
+   */
+  public static long toDrillTimestamp(Instant instant, ZoneId zoneId) {
+    LocalDateTime ldt = instant.atZone(zoneId).toLocalDateTime();
+    return ldt.atZone(ZoneId.of("UTC")).toEpochSecond()*1000;

Review comment:
       Good catch, thanks.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to