File tree 1 file changed +7
-6
lines changed
rqueue-core/src/main/java/com/github/sonus21/rqueue/utils
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import java .time .Instant ;
20
20
import java .time .LocalDate ;
21
- import java .time .ZoneOffset ;
21
+ import java .time .ZoneId ;
22
22
import java .time .ZonedDateTime ;
23
23
import java .time .format .DateTimeFormatter ;
24
24
25
25
public final class DateTimeUtils {
26
26
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" );
28
28
29
- DateTimeUtils () {}
29
+ DateTimeUtils () {
30
+ }
30
31
31
32
private static String hourString (long hour ) {
32
33
if (hour > 1 ) {
@@ -116,15 +117,15 @@ public static String formatMilliToString(Long milli) {
116
117
return "" ;
117
118
}
118
119
Instant instant = Instant .ofEpochMilli (milli );
119
- ZonedDateTime zonedDateTime = ZonedDateTime .ofInstant (instant , java . time . ZoneId .of ( "UTC" ));
120
+ ZonedDateTime zonedDateTime = ZonedDateTime .ofInstant (instant , ZoneId .systemDefault ( ));
120
121
return zonedDateTime .format (simple );
121
122
}
122
123
123
124
public static LocalDate localDateFromMilli (long millis ) {
124
- return Instant .ofEpochMilli (millis ).atZone (ZoneOffset . UTC ).toLocalDate ();
125
+ return Instant .ofEpochMilli (millis ).atZone (ZoneId . systemDefault () ).toLocalDate ();
125
126
}
126
127
127
128
public static LocalDate today () {
128
- return LocalDate .now (ZoneOffset . UTC );
129
+ return LocalDate .now (ZoneId . systemDefault () );
129
130
}
130
131
}
You can’t perform that action at this time.
0 commit comments