xiangfu0 commented on a change in pull request #7552:
URL: https://github.com/apache/pinot/pull/7552#discussion_r725532983



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DateTimeFunctions.java
##########
@@ -256,6 +257,17 @@ public static String toDateTime(long millis, String 
pattern) {
     return DateTimePatternHandler.parseEpochMillisToDateTimeString(millis, 
pattern);
   }
 
+  /**
+   * Converts epoch millis to DateTime string represented by pattern
+   * and the time zone id.
+   */
+  @ScalarFunction
+  public static String toDateTime(long millis, String pattern, String 
timezoneId) {
+    return DateTimeFormat
+            .forPattern(pattern)
+            .withZone(DateTimeZone.forID(timezoneId)).print(millis);
+  }
+

Review comment:
       just for the completeness, can you also add a scalar function for 
`fromDateTime(String dateTimeString, String pattern, String timezoneId)`




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to