|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2015 the original author or authors. |
| 2 | + * Copyright 2002-2016 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -124,27 +124,19 @@ public void shouldPrintAndParseISOTime() throws Exception {
|
124 | 124 | formatter.setTimeZone(UTC);
|
125 | 125 | formatter.setIso(ISO.TIME);
|
126 | 126 | Date date = getDate(2009, Calendar.JANUARY, 1, 14, 23, 5, 3);
|
127 |
| - assertThat(formatter.print(date, Locale.US), is("14:23:05.003+0000")); |
128 |
| - assertThat(formatter.parse("14:23:05.003+0000", Locale.US), |
| 127 | + assertThat(formatter.print(date, Locale.US), is("14:23:05.003Z")); |
| 128 | + assertThat(formatter.parse("14:23:05.003Z", Locale.US), |
129 | 129 | is(getDate(1970, Calendar.JANUARY, 1, 14, 23, 5, 3)));
|
130 | 130 | }
|
131 | 131 |
|
132 |
| - @Test |
133 |
| - public void shouldParseIsoTimeWithZeros() throws Exception { |
134 |
| - DateFormatter formatter = new DateFormatter(); |
135 |
| - formatter.setIso(ISO.TIME); |
136 |
| - Date date = formatter.parse("12:00:00.000-00005", Locale.US); |
137 |
| - System.out.println(date); |
138 |
| - } |
139 |
| - |
140 | 132 | @Test
|
141 | 133 | public void shouldPrintAndParseISODateTime() throws Exception {
|
142 | 134 | DateFormatter formatter = new DateFormatter();
|
143 | 135 | formatter.setTimeZone(UTC);
|
144 | 136 | formatter.setIso(ISO.DATE_TIME);
|
145 | 137 | Date date = getDate(2009, Calendar.JUNE, 1, 14, 23, 5, 3);
|
146 |
| - assertThat(formatter.print(date, Locale.US), is("2009-06-01T14:23:05.003+0000")); |
147 |
| - assertThat(formatter.parse("2009-06-01T14:23:05.003+0000", Locale.US), is(date)); |
| 138 | + assertThat(formatter.print(date, Locale.US), is("2009-06-01T14:23:05.003Z")); |
| 139 | + assertThat(formatter.parse("2009-06-01T14:23:05.003Z", Locale.US), is(date)); |
148 | 140 | }
|
149 | 141 |
|
150 | 142 | @Test
|
@@ -201,7 +193,7 @@ public void shouldUseCorrectOrder() throws Exception {
|
201 | 193 | assertThat("uses pattern",formatter.print(date, Locale.US), is("2009"));
|
202 | 194 |
|
203 | 195 | formatter.setPattern("");
|
204 |
| - assertThat("uses ISO", formatter.print(date, Locale.US), is("2009-06-01T14:23:05.003+0000")); |
| 196 | + assertThat("uses ISO", formatter.print(date, Locale.US), is("2009-06-01T14:23:05.003Z")); |
205 | 197 |
|
206 | 198 | formatter.setIso(ISO.NONE);
|
207 | 199 | assertThat("uses style pattern", formatter.print(date, Locale.US), is("June 1, 2009"));
|
|
0 commit comments