Skip to content

Commit

Permalink
[alerter] fix time zone todo issue (#210)
Browse files Browse the repository at this point in the history
  an

  fix timezone issue

Co-authored-by: djzeng <djzeng@trip.com>
  • Loading branch information
2 people authored and tomsun28 committed Jul 10, 2022
1 parent 01179f9 commit 5feb20f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.math.RoundingMode;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.ZoneId;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -134,8 +134,7 @@ private Alert buildAlertData(AlertReport alertReport){
.tags(alertReport.getLabels())
.target(CommonConstants.AVAILABLE)
.times(3)
// todo 时区问题
.gmtCreate(LocalDateTime.ofInstant(Instant.ofEpochMilli(alertReport.getAlertTime()), ZoneOffset.of("+8")))
.gmtCreate(LocalDateTime.ofInstant(Instant.ofEpochMilli(alertReport.getAlertTime()), ZoneId.systemDefault()))
.build();
}

Expand Down

0 comments on commit 5feb20f

Please sign in to comment.