Add new date format (#7189)
This commit is contained in:
parent
84b6f442fc
commit
fc1c13f4a5
|
@ -92,6 +92,7 @@ public abstract class DateUtils {
|
||||||
"EEE MMM d HH:mm yyyy",
|
"EEE MMM d HH:mm yyyy",
|
||||||
"yyyy-MM-dd'T'HH:mm:ss",
|
"yyyy-MM-dd'T'HH:mm:ss",
|
||||||
"yyyy-MM-dd'T'HH:mm:ss.SSS Z",
|
"yyyy-MM-dd'T'HH:mm:ss.SSS Z",
|
||||||
|
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
|
||||||
"yyyy-MM-dd'T'HH:mm:ss.SSS",
|
"yyyy-MM-dd'T'HH:mm:ss.SSS",
|
||||||
"yyyy-MM-dd'T'HH:mm:ssZ",
|
"yyyy-MM-dd'T'HH:mm:ssZ",
|
||||||
"yyyy-MM-dd'T'HH:mm:ss'Z'",
|
"yyyy-MM-dd'T'HH:mm:ss'Z'",
|
||||||
|
|
|
@ -33,6 +33,15 @@ public class DateUtilsTest {
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testParseDateWithZuluTimezone() {
|
||||||
|
GregorianCalendar exp = new GregorianCalendar(2024, 4, 8, 22, 18, 52);
|
||||||
|
exp.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
Date expected = new Date(exp.getTimeInMillis() + 485);
|
||||||
|
Date actual = DateUtils.parse("2024-05-08T22:18:52.485Z");
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testParseDateWithDeciseconds() {
|
public void testParseDateWithDeciseconds() {
|
||||||
GregorianCalendar exp = new GregorianCalendar(2015, 2, 28, 13, 31, 4);
|
GregorianCalendar exp = new GregorianCalendar(2015, 2, 28, 13, 31, 4);
|
||||||
|
|
Loading…
Reference in New Issue