File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
rqueue-core/src/main/java/com/github/sonus21/rqueue/utils Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1818
1919import java .time .Instant ;
2020import java .time .LocalDate ;
21- import java .time .ZoneOffset ;
21+ import java .time .ZoneId ;
2222import java .time .ZonedDateTime ;
2323import java .time .format .DateTimeFormatter ;
2424
2525public final class DateTimeUtils {
2626
27- private static final DateTimeFormatter simple = DateTimeFormatter .ofPattern ("dd MMM yyyy HH:mm" );
27+ private static final DateTimeFormatter simple = DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm" );
2828
29- DateTimeUtils () {}
29+ DateTimeUtils () {
30+ }
3031
3132 private static String hourString (long hour ) {
3233 if (hour > 1 ) {
@@ -116,15 +117,15 @@ public static String formatMilliToString(Long milli) {
116117 return "" ;
117118 }
118119 Instant instant = Instant .ofEpochMilli (milli );
119- ZonedDateTime zonedDateTime = ZonedDateTime .ofInstant (instant , java . time . ZoneId .of ( "UTC" ));
120+ ZonedDateTime zonedDateTime = ZonedDateTime .ofInstant (instant , ZoneId .systemDefault ( ));
120121 return zonedDateTime .format (simple );
121122 }
122123
123124 public static LocalDate localDateFromMilli (long millis ) {
124- return Instant .ofEpochMilli (millis ).atZone (ZoneOffset . UTC ).toLocalDate ();
125+ return Instant .ofEpochMilli (millis ).atZone (ZoneId . systemDefault () ).toLocalDate ();
125126 }
126127
127128 public static LocalDate today () {
128- return LocalDate .now (ZoneOffset . UTC );
129+ return LocalDate .now (ZoneId . systemDefault () );
129130 }
130131}
You can’t perform that action at this time.
0 commit comments