You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/30 01:05:31 UTC

[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #12220: [fix#12195] Change date to timestamp to support cross diff time zones

ruanwenjun commented on code in PR #12220:
URL: https://github.com/apache/dolphinscheduler/pull/12220#discussion_r984127935


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DateUtils.java:
##########
@@ -646,4 +646,23 @@ public static long toDurationHours(long d) {
 
     }
 
+    /**
+     * transform timeStamp to local date
+     *
+     * @param timeStamp time stamp (milliseconds)
+     * @return local date
+     */
+    public static Date timeStampToLocalDate(long timeStamp) {
+        return timeStamp == 0L ? null : new Date(Long.parseLong(String.valueOf(timeStamp)));
+    }

Review Comment:
   ```suggestion
       public static @Nuallable Date timeStampToDate(long timeStamp) {
           return timeStamp <= 0L ? null : new Date(timeStamp);
       }
   ```



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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