(String s)
| 145 | // accept the trailing zone word; java.time's strict parsers do not. |
| 146 | // Strip a trailing " UTC"/" GMT" so the rest of the parsing succeeds. |
| 147 | private static String stripUtcSuffix(String s) { |
| 148 | int len = s.length(); |
| 149 | if (len >= 4) { |
| 150 | String tail = s.substring(len - 4); |
| 151 | if (tail.equalsIgnoreCase(" UTC") || tail.equalsIgnoreCase(" GMT")) { |
| 152 | return s.substring(0, len - 4).trim(); |
| 153 | } |
| 154 | } |
| 155 | return s; |
| 156 | } |
| 157 | |
| 158 | // -------- iso8601 formatting -------- |
| 159 |