182 * Implementations of {@code TemporalAccessor} should provide a value for this field if |
206 * Implementations of {@code TemporalAccessor} should provide a value for this field if |
183 * they can return a value for {@link #SECOND_OF_DAY} filling unknown precision with zero. |
207 * they can return a value for {@link #SECOND_OF_DAY} filling unknown precision with zero. |
184 * <p> |
208 * <p> |
185 * When this field is used for setting a value, it should behave in the same way as |
209 * When this field is used for setting a value, it should behave in the same way as |
186 * setting {@link #NANO_OF_DAY} with the value multiplied by 1,000,000. |
210 * setting {@link #NANO_OF_DAY} with the value multiplied by 1,000,000. |
|
211 * <p> |
|
212 * When parsing this field it behaves equivalent to the following: |
|
213 * The value is validated in strict and smart mode but not in lenient mode. |
|
214 * The value is split to form {@code MILLI_OF_SECOND}, {@code SECOND_OF_MINUTE}, |
|
215 * {@code MINUTE_OF_HOUR} and {@code HOUR_OF_DAY} fields. |
187 */ |
216 */ |
188 MILLI_OF_DAY("MilliOfDay", MILLIS, DAYS, ValueRange.of(0, 86400L * 1000L - 1)), |
217 MILLI_OF_DAY("MilliOfDay", MILLIS, DAYS, ValueRange.of(0, 86400L * 1000L - 1)), |
189 /** |
218 /** |
190 * The second-of-minute. |
219 * The second-of-minute. |
191 * <p> |
220 * <p> |
192 * This counts the second within the minute, from 0 to 59. |
221 * This counts the second within the minute, from 0 to 59. |
193 * This field has the same meaning for all calendar systems. |
222 * This field has the same meaning for all calendar systems. |
|
223 * <p> |
|
224 * When parsing this field it behaves equivalent to the following: |
|
225 * The value is validated in strict and smart mode but not in lenient mode. |
194 */ |
226 */ |
195 SECOND_OF_MINUTE("SecondOfMinute", SECONDS, MINUTES, ValueRange.of(0, 59), "second"), |
227 SECOND_OF_MINUTE("SecondOfMinute", SECONDS, MINUTES, ValueRange.of(0, 59), "second"), |
196 /** |
228 /** |
197 * The second-of-day. |
229 * The second-of-day. |
198 * <p> |
230 * <p> |
199 * This counts the second within the day, from 0 to (24 * 60 * 60) - 1. |
231 * This counts the second within the day, from 0 to (24 * 60 * 60) - 1. |
200 * This field has the same meaning for all calendar systems. |
232 * This field has the same meaning for all calendar systems. |
|
233 * <p> |
|
234 * When parsing this field it behaves equivalent to the following: |
|
235 * The value is validated in strict and smart mode but not in lenient mode. |
|
236 * The value is split to form {@code SECOND_OF_MINUTE}, {@code MINUTE_OF_HOUR} |
|
237 * and {@code HOUR_OF_DAY} fields. |
201 */ |
238 */ |
202 SECOND_OF_DAY("SecondOfDay", SECONDS, DAYS, ValueRange.of(0, 86400L - 1)), |
239 SECOND_OF_DAY("SecondOfDay", SECONDS, DAYS, ValueRange.of(0, 86400L - 1)), |
203 /** |
240 /** |
204 * The minute-of-hour. |
241 * The minute-of-hour. |
205 * <p> |
242 * <p> |
206 * This counts the minute within the hour, from 0 to 59. |
243 * This counts the minute within the hour, from 0 to 59. |
207 * This field has the same meaning for all calendar systems. |
244 * This field has the same meaning for all calendar systems. |
|
245 * <p> |
|
246 * When parsing this field it behaves equivalent to the following: |
|
247 * The value is validated in strict and smart mode but not in lenient mode. |
208 */ |
248 */ |
209 MINUTE_OF_HOUR("MinuteOfHour", MINUTES, HOURS, ValueRange.of(0, 59), "minute"), |
249 MINUTE_OF_HOUR("MinuteOfHour", MINUTES, HOURS, ValueRange.of(0, 59), "minute"), |
210 /** |
250 /** |
211 * The minute-of-day. |
251 * The minute-of-day. |
212 * <p> |
252 * <p> |
213 * This counts the minute within the day, from 0 to (24 * 60) - 1. |
253 * This counts the minute within the day, from 0 to (24 * 60) - 1. |
214 * This field has the same meaning for all calendar systems. |
254 * This field has the same meaning for all calendar systems. |
|
255 * <p> |
|
256 * When parsing this field it behaves equivalent to the following: |
|
257 * The value is validated in strict and smart mode but not in lenient mode. |
|
258 * The value is split to form {@code MINUTE_OF_HOUR} and {@code HOUR_OF_DAY} fields. |
215 */ |
259 */ |
216 MINUTE_OF_DAY("MinuteOfDay", MINUTES, DAYS, ValueRange.of(0, (24 * 60) - 1)), |
260 MINUTE_OF_DAY("MinuteOfDay", MINUTES, DAYS, ValueRange.of(0, (24 * 60) - 1)), |
217 /** |
261 /** |
218 * The hour-of-am-pm. |
262 * The hour-of-am-pm. |
219 * <p> |
263 * <p> |
220 * This counts the hour within the AM/PM, from 0 to 11. |
264 * This counts the hour within the AM/PM, from 0 to 11. |
221 * This is the hour that would be observed on a standard 12-hour digital clock. |
265 * This is the hour that would be observed on a standard 12-hour digital clock. |
222 * This field has the same meaning for all calendar systems. |
266 * This field has the same meaning for all calendar systems. |
|
267 * <p> |
|
268 * When parsing this field it behaves equivalent to the following: |
|
269 * The value is validated from 0 to 11 in strict and smart mode. |
|
270 * In lenient mode the value is not validated. It is combined with |
|
271 * {@code AMPM_OF_DAY} to form {@code HOUR_OF_DAY} by multiplying |
|
272 * the {AMPM_OF_DAY} value by 12. |
223 */ |
273 */ |
224 HOUR_OF_AMPM("HourOfAmPm", HOURS, HALF_DAYS, ValueRange.of(0, 11)), |
274 HOUR_OF_AMPM("HourOfAmPm", HOURS, HALF_DAYS, ValueRange.of(0, 11)), |
225 /** |
275 /** |
226 * The clock-hour-of-am-pm. |
276 * The clock-hour-of-am-pm. |
227 * <p> |
277 * <p> |
228 * This counts the hour within the AM/PM, from 1 to 12. |
278 * This counts the hour within the AM/PM, from 1 to 12. |
229 * This is the hour that would be observed on a standard 12-hour analog wall clock. |
279 * This is the hour that would be observed on a standard 12-hour analog wall clock. |
230 * This field has the same meaning for all calendar systems. |
280 * This field has the same meaning for all calendar systems. |
|
281 * <p> |
|
282 * When parsing this field it behaves equivalent to the following: |
|
283 * The value is validated from 1 to 12 in strict mode and from |
|
284 * 0 to 12 in smart mode. In lenient mode the value is not validated. |
|
285 * The field is converted to an {@code HOUR_OF_AMPM} with the same value, |
|
286 * unless the value is 12, in which case it is converted to 0. |
231 */ |
287 */ |
232 CLOCK_HOUR_OF_AMPM("ClockHourOfAmPm", HOURS, HALF_DAYS, ValueRange.of(1, 12)), |
288 CLOCK_HOUR_OF_AMPM("ClockHourOfAmPm", HOURS, HALF_DAYS, ValueRange.of(1, 12)), |
233 /** |
289 /** |
234 * The hour-of-day. |
290 * The hour-of-day. |
235 * <p> |
291 * <p> |
236 * This counts the hour within the day, from 0 to 23. |
292 * This counts the hour within the day, from 0 to 23. |
237 * This is the hour that would be observed on a standard 24-hour digital clock. |
293 * This is the hour that would be observed on a standard 24-hour digital clock. |
238 * This field has the same meaning for all calendar systems. |
294 * This field has the same meaning for all calendar systems. |
|
295 * <p> |
|
296 * When parsing this field it behaves equivalent to the following: |
|
297 * The value is validated in strict and smart mode but not in lenient mode. |
|
298 * The field is combined with {@code MINUTE_OF_HOUR}, {@code SECOND_OF_MINUTE} and |
|
299 * {@code NANO_OF_SECOND} to produce a {@code LocalTime}. |
|
300 * In lenient mode, any excess days are added to the parsed date, or |
|
301 * made available via {@link java.time.format.DateTimeFormatter#parsedExcessDays()}. |
239 */ |
302 */ |
240 HOUR_OF_DAY("HourOfDay", HOURS, DAYS, ValueRange.of(0, 23), "hour"), |
303 HOUR_OF_DAY("HourOfDay", HOURS, DAYS, ValueRange.of(0, 23), "hour"), |
241 /** |
304 /** |
242 * The clock-hour-of-day. |
305 * The clock-hour-of-day. |
243 * <p> |
306 * <p> |
244 * This counts the hour within the AM/PM, from 1 to 24. |
307 * This counts the hour within the AM/PM, from 1 to 24. |
245 * This is the hour that would be observed on a 24-hour analog wall clock. |
308 * This is the hour that would be observed on a 24-hour analog wall clock. |
246 * This field has the same meaning for all calendar systems. |
309 * This field has the same meaning for all calendar systems. |
|
310 * <p> |
|
311 * When parsing this field it behaves equivalent to the following: |
|
312 * The value is validated from 1 to 24 in strict mode and from |
|
313 * 0 to 24 in smart mode. In lenient mode the value is not validated. |
|
314 * The field is converted to an {@code HOUR_OF_DAY} with the same value, |
|
315 * unless the value is 24, in which case it is converted to 0. |
247 */ |
316 */ |
248 CLOCK_HOUR_OF_DAY("ClockHourOfDay", HOURS, DAYS, ValueRange.of(1, 24)), |
317 CLOCK_HOUR_OF_DAY("ClockHourOfDay", HOURS, DAYS, ValueRange.of(1, 24)), |
249 /** |
318 /** |
250 * The am-pm-of-day. |
319 * The am-pm-of-day. |
251 * <p> |
320 * <p> |
252 * This counts the AM/PM within the day, from 0 (AM) to 1 (PM). |
321 * This counts the AM/PM within the day, from 0 (AM) to 1 (PM). |
253 * This field has the same meaning for all calendar systems. |
322 * This field has the same meaning for all calendar systems. |
|
323 * <p> |
|
324 * When parsing this field it behaves equivalent to the following: |
|
325 * The value is validated from 0 to 1 in strict and smart mode. |
|
326 * In lenient mode the value is not validated. It is combined with |
|
327 * {@code HOUR_OF_AMPM} to form {@code HOUR_OF_DAY} by multiplying |
|
328 * the {AMPM_OF_DAY} value by 12. |
254 */ |
329 */ |
255 AMPM_OF_DAY("AmPmOfDay", HALF_DAYS, DAYS, ValueRange.of(0, 1), "dayperiod"), |
330 AMPM_OF_DAY("AmPmOfDay", HALF_DAYS, DAYS, ValueRange.of(0, 1), "dayperiod"), |
256 /** |
331 /** |
257 * The day-of-week, such as Tuesday. |
332 * The day-of-week, such as Tuesday. |
258 * <p> |
333 * <p> |