Prints to an Appendable the string representation (in Ion format) of this Timestamp in UTC. This method produces the same output as #toZString(). @param out not null @throws IOException propagated when the Appendable throws it. @throws IonException if the text r
(Appendable out)
| 2178 | * @see #print(Appendable) |
| 2179 | */ |
| 2180 | public void printZ(Appendable out) |
| 2181 | throws IOException |
| 2182 | { |
| 2183 | switch (_precision) |
| 2184 | { |
| 2185 | case YEAR: |
| 2186 | case MONTH: |
| 2187 | case DAY: |
| 2188 | { |
| 2189 | assert _offset == UNKNOWN_OFFSET; |
| 2190 | // No need to adjust offset, we won't be using it. |
| 2191 | print(out); |
| 2192 | break; |
| 2193 | } |
| 2194 | case MINUTE: |
| 2195 | case SECOND: |
| 2196 | case FRACTION: |
| 2197 | { |
| 2198 | Timestamp ztime = this.clone(); |
| 2199 | ztime._offset = UTC_OFFSET; |
| 2200 | ztime.print(out); |
| 2201 | break; |
| 2202 | } |
| 2203 | } |
| 2204 | } |
| 2205 | |
| 2206 | |
| 2207 | /** |