caishunfeng commented on code in PR #9830:
URL: https://github.com/apache/dolphinscheduler/pull/9830#discussion_r860804467


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java:
##########
@@ -173,8 +174,12 @@ public Map<String, Object> insertSchedule(User loginUser,
             putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR);
             return result;
         }
-        scheduleObj.setStartTime(scheduleParam.getStartTime());
-        scheduleObj.setEndTime(scheduleParam.getEndTime());
+
+        // transform timezone from system default timezone to schedule timezone
+        Date startTime = 
DateUtils.transformTimezoneDate(scheduleParam.getStartTime(), 
scheduleParam.getTimezoneId());
+        Date endTime = 
DateUtils.transformTimezoneDate(scheduleParam.getEndTime(), 
scheduleParam.getTimezoneId());
+        scheduleObj.setStartTime(startTime);
+        scheduleObj.setEndTime(endTime);

Review Comment:
   @ruanwenjun Thanks for your good suggestion, I have recovered the 
`lazy-transform` logic, please review again.



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