|
@@ -62,7 +62,7 @@ import java.security.SecureRandom;
|
62
|
62
|
import java.time.Instant;
|
63
|
63
|
import java.time.LocalDateTime;
|
64
|
64
|
import java.time.ZoneId;
|
65
|
|
-import java.time.ZoneOffset;
|
|
65
|
+import java.time.OffsetDateTime;
|
66
|
66
|
import java.time.format.DateTimeFormatter;
|
67
|
67
|
import java.time.format.DateTimeParseException;
|
68
|
68
|
import java.util.ArrayList;
|
|
@@ -118,6 +118,9 @@ public class IRCParser extends BaseSocketAwareParser implements SecureParser, En
|
118
|
118
|
/** Byte used to show that a non-boolean mode is not a list, and requires a parameter to unset (k). */
|
119
|
119
|
public static final byte MODE_UNSET = 4;
|
120
|
120
|
|
|
121
|
+ /** server-time time format */
|
|
122
|
+ private static final DateTimeFormatter serverTimeFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX");
|
|
123
|
+
|
121
|
124
|
/**
|
122
|
125
|
* Default channel prefixes if none are specified by the IRCd.
|
123
|
126
|
*
|
|
@@ -1132,9 +1135,8 @@ public class IRCParser extends BaseSocketAwareParser implements SecureParser, En
|
1132
|
1135
|
} catch (final NumberFormatException nfe) { /* Do nothing. */ }
|
1133
|
1136
|
} else if (line.getTags().containsKey("time")) {
|
1134
|
1137
|
try {
|
1135
|
|
- lineTS = LocalDateTime.parse(line.getTags().get("time"),
|
1136
|
|
- DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
|
1137
|
|
- lineTS = lineTS.atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime();
|
|
1138
|
+ lineTS = OffsetDateTime.parse(line.getTags().get("time"), serverTimeFormat)
|
|
1139
|
+ .atZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime();
|
1138
|
1140
|
} catch (final DateTimeParseException pe) { /* Do nothing. */ }
|
1139
|
1141
|
}
|
1140
|
1142
|
|