@@ -108,9 +108,6 @@ public class DateFormatters {
108
108
.appendLiteral (':' )
109
109
.appendValue (SECOND_OF_MINUTE , 2 , 2 , SignStyle .NOT_NEGATIVE )
110
110
.optionalStart ()
111
- .appendFraction (NANO_OF_SECOND , 3 , 3 , true )
112
- .optionalEnd ()
113
- .optionalStart ()
114
111
.appendFraction (NANO_OF_SECOND , 3 , 9 , true )
115
112
.optionalEnd ()
116
113
.optionalEnd ()
@@ -205,7 +202,7 @@ public class DateFormatters {
205
202
.appendValue (HOUR_OF_DAY , 2 , 2 , SignStyle .NOT_NEGATIVE )
206
203
.appendValue (MINUTE_OF_HOUR , 2 , 2 , SignStyle .NOT_NEGATIVE )
207
204
.appendValue (SECOND_OF_MINUTE , 2 , 2 , SignStyle .NOT_NEGATIVE )
208
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
205
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
209
206
.toFormatter (Locale .ROOT );
210
207
211
208
private static final DateTimeFormatter BASIC_TIME_PRINTER = new DateTimeFormatterBuilder ()
@@ -311,7 +308,7 @@ public class DateFormatters {
311
308
private static final DateFormatter BASIC_ORDINAL_DATE_TIME = new JavaDateFormatter ("basic_ordinal_date_time" ,
312
309
new DateTimeFormatterBuilder ().appendPattern ("yyyyDDD" ).append (BASIC_T_TIME_PRINTER )
313
310
.appendZoneOrOffsetId ().toFormatter (Locale .ROOT ),
314
- new DateTimeFormatterBuilder ().appendPattern ("yyyyDDD" ).append (BASIC_T_TIME_PRINTER )
311
+ new DateTimeFormatterBuilder ().appendPattern ("yyyyDDD" ).append (BASIC_T_TIME_FORMATTER )
315
312
.appendZoneOrOffsetId ().toFormatter (Locale .ROOT ),
316
313
new DateTimeFormatterBuilder ().appendPattern ("yyyyDDD" ).append (BASIC_T_TIME_FORMATTER )
317
314
.append (TIME_ZONE_FORMATTER_NO_COLON ).toFormatter (Locale .ROOT )
@@ -419,7 +416,7 @@ public class DateFormatters {
419
416
.appendValue (HOUR_OF_DAY , 2 , 2 , SignStyle .NOT_NEGATIVE )
420
417
.appendValue (MINUTE_OF_HOUR , 2 , 2 , SignStyle .NOT_NEGATIVE )
421
418
.appendValue (SECOND_OF_MINUTE , 2 , 2 , SignStyle .NOT_NEGATIVE )
422
- .appendFraction (NANO_OF_SECOND , 3 , 3 , true )
419
+ .appendFraction (NANO_OF_SECOND , 3 , 9 , true )
423
420
.appendZoneOrOffsetId ()
424
421
.toFormatter (Locale .ROOT ),
425
422
new DateTimeFormatterBuilder ()
@@ -428,7 +425,7 @@ public class DateFormatters {
428
425
.appendValue (HOUR_OF_DAY , 2 , 2 , SignStyle .NOT_NEGATIVE )
429
426
.appendValue (MINUTE_OF_HOUR , 2 , 2 , SignStyle .NOT_NEGATIVE )
430
427
.appendValue (SECOND_OF_MINUTE , 2 , 2 , SignStyle .NOT_NEGATIVE )
431
- .appendFraction (NANO_OF_SECOND , 3 , 3 , true )
428
+ .appendFraction (NANO_OF_SECOND , 3 , 9 , true )
432
429
.append (TIME_ZONE_FORMATTER_NO_COLON )
433
430
.toFormatter (Locale .ROOT )
434
431
);
@@ -485,7 +482,7 @@ public class DateFormatters {
485
482
.appendLiteral ('T' )
486
483
.append (STRICT_HOUR_MINUTE_SECOND_FORMATTER )
487
484
.optionalStart ()
488
- .appendFraction (NANO_OF_SECOND , 3 , 3 , true )
485
+ .appendFraction (NANO_OF_SECOND , 3 , 9 , true )
489
486
.optionalEnd ()
490
487
.toFormatter (Locale .ROOT );
491
488
@@ -542,7 +539,7 @@ public class DateFormatters {
542
539
// NOTE: this is not a strict formatter to retain the joda time based behaviour, even though it's named like this
543
540
private static final DateTimeFormatter STRICT_HOUR_MINUTE_SECOND_MILLIS_FORMATTER = new DateTimeFormatterBuilder ()
544
541
.append (STRICT_HOUR_MINUTE_SECOND_FORMATTER )
545
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
542
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
546
543
.toFormatter (Locale .ROOT );
547
544
548
545
private static final DateTimeFormatter STRICT_HOUR_MINUTE_SECOND_MILLIS_PRINTER = new DateTimeFormatterBuilder ()
@@ -582,8 +579,8 @@ public class DateFormatters {
582
579
.append (STRICT_YEAR_MONTH_DAY_FORMATTER )
583
580
.appendLiteral ("T" )
584
581
.append (STRICT_HOUR_MINUTE_SECOND_FORMATTER )
585
- // this one here is lenient as well to retain joda time based bwc compatibility
586
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
582
+ // this one here is lenient as well to retain joda time based bwc compatibility
583
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
587
584
.toFormatter (Locale .ROOT )
588
585
);
589
586
@@ -599,7 +596,7 @@ public class DateFormatters {
599
596
.appendLiteral ("T" )
600
597
.append (STRICT_HOUR_MINUTE_SECOND_FORMATTER )
601
598
// this one here is lenient as well to retain joda time based bwc compatibility
602
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
599
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
603
600
.toFormatter (Locale .ROOT )
604
601
);
605
602
@@ -625,7 +622,7 @@ public class DateFormatters {
625
622
.optionalStart ()
626
623
.appendLiteral (':' )
627
624
.appendValue (SECOND_OF_MINUTE , 2 , 2 , SignStyle .NOT_NEGATIVE )
628
- .appendFraction (NANO_OF_SECOND , 3 , 3 , true )
625
+ .appendFraction (NANO_OF_SECOND , 3 , 9 , true )
629
626
.optionalEnd ()
630
627
.toFormatter (Locale .ROOT );
631
628
@@ -649,7 +646,7 @@ public class DateFormatters {
649
646
.appendValue (MINUTE_OF_HOUR , 2 , 2 , SignStyle .NOT_NEGATIVE )
650
647
.appendLiteral (':' )
651
648
.appendValue (SECOND_OF_MINUTE , 2 , 2 , SignStyle .NOT_NEGATIVE )
652
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
649
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
653
650
.toFormatter (Locale .ROOT );
654
651
655
652
private static final DateTimeFormatter STRICT_TIME_PRINTER = new DateTimeFormatterBuilder ()
@@ -880,7 +877,7 @@ public class DateFormatters {
880
877
.appendValue (SECOND_OF_MINUTE , 1 , 2 , SignStyle .NOT_NEGATIVE )
881
878
.optionalEnd ()
882
879
.optionalStart ()
883
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
880
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
884
881
.optionalEnd ()
885
882
.optionalStart ().appendZoneOrOffsetId ().optionalEnd ()
886
883
.optionalStart ().appendOffset ("+HHmm" , "Z" ).optionalEnd ()
@@ -904,6 +901,15 @@ public class DateFormatters {
904
901
.appendFraction (NANO_OF_SECOND , 1 , 3 , true )
905
902
.toFormatter (Locale .ROOT );
906
903
904
+ private static final DateTimeFormatter HOUR_MINUTE_SECOND_FRACTION_FORMATTER = new DateTimeFormatterBuilder ()
905
+ .appendValue (HOUR_OF_DAY , 1 , 2 , SignStyle .NOT_NEGATIVE )
906
+ .appendLiteral (':' )
907
+ .appendValue (MINUTE_OF_HOUR , 1 , 2 , SignStyle .NOT_NEGATIVE )
908
+ .appendLiteral (':' )
909
+ .appendValue (SECOND_OF_MINUTE , 1 , 2 , SignStyle .NOT_NEGATIVE )
910
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
911
+ .toFormatter (Locale .ROOT );
912
+
907
913
private static final DateTimeFormatter ORDINAL_DATE_FORMATTER = new DateTimeFormatterBuilder ()
908
914
.appendValue (ChronoField .YEAR , 4 , 10 , SignStyle .EXCEEDS_PAD )
909
915
.appendLiteral ('-' )
@@ -936,7 +942,7 @@ public class DateFormatters {
936
942
937
943
private static final DateTimeFormatter TIME_PREFIX = new DateTimeFormatterBuilder ()
938
944
.append (TIME_NO_MILLIS_FORMATTER )
939
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
945
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
940
946
.toFormatter (Locale .ROOT );
941
947
942
948
private static final DateTimeFormatter WEEK_DATE_FORMATTER = new DateTimeFormatterBuilder ()
@@ -974,8 +980,7 @@ public class DateFormatters {
974
980
/*
975
981
* Returns a formatter that combines a full date, two digit hour of day,
976
982
* two digit minute of hour, two digit second of minute, and three digit
977
- * fraction of second (yyyy-MM-dd'T'HH:mm:ss.SSS). Parsing will parse up
978
- * to 3 fractional second digits.
983
+ * fraction of second (yyyy-MM-dd'T'HH:mm:ss.SSS).
979
984
*/
980
985
private static final DateFormatter DATE_HOUR_MINUTE_SECOND_MILLIS =
981
986
new JavaDateFormatter ("date_hour_minute_second_millis" ,
@@ -990,7 +995,8 @@ public class DateFormatters {
990
995
.append (HOUR_MINUTE_SECOND_MILLIS_FORMATTER )
991
996
.toFormatter (Locale .ROOT ));
992
997
993
- private static final DateFormatter DATE_HOUR_MINUTE_SECOND_FRACTION = new JavaDateFormatter ("date_hour_minute_second_fraction" ,
998
+ private static final DateFormatter DATE_HOUR_MINUTE_SECOND_FRACTION =
999
+ new JavaDateFormatter ("date_hour_minute_second_fraction" ,
994
1000
new DateTimeFormatterBuilder ()
995
1001
.append (STRICT_YEAR_MONTH_DAY_FORMATTER )
996
1002
.appendLiteral ("T" )
@@ -999,7 +1005,7 @@ public class DateFormatters {
999
1005
new DateTimeFormatterBuilder ()
1000
1006
.append (DATE_FORMATTER )
1001
1007
.appendLiteral ("T" )
1002
- .append (HOUR_MINUTE_SECOND_MILLIS_FORMATTER )
1008
+ .append (HOUR_MINUTE_SECOND_FRACTION_FORMATTER )
1003
1009
.toFormatter (Locale .ROOT ));
1004
1010
1005
1011
/*
@@ -1034,7 +1040,7 @@ public class DateFormatters {
1034
1040
.optionalStart ()
1035
1041
.appendLiteral (':' )
1036
1042
.appendValue (SECOND_OF_MINUTE , 1 , 2 , SignStyle .NOT_NEGATIVE )
1037
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
1043
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
1038
1044
.optionalEnd ()
1039
1045
.toFormatter (Locale .ROOT );
1040
1046
@@ -1106,7 +1112,7 @@ public class DateFormatters {
1106
1112
STRICT_HOUR_MINUTE_SECOND_MILLIS_PRINTER , HOUR_MINUTE_SECOND_MILLIS_FORMATTER );
1107
1113
1108
1114
private static final DateFormatter HOUR_MINUTE_SECOND_FRACTION = new JavaDateFormatter ("hour_minute_second_fraction" ,
1109
- STRICT_HOUR_MINUTE_SECOND_MILLIS_PRINTER , HOUR_MINUTE_SECOND_MILLIS_FORMATTER );
1115
+ STRICT_HOUR_MINUTE_SECOND_MILLIS_PRINTER , HOUR_MINUTE_SECOND_FRACTION_FORMATTER );
1110
1116
1111
1117
/*
1112
1118
* Returns a formatter for a two digit hour of day and two digit minute of
@@ -1142,7 +1148,7 @@ public class DateFormatters {
1142
1148
.optionalStart ()
1143
1149
.appendLiteral (':' )
1144
1150
.appendValue (SECOND_OF_MINUTE , 1 , 2 , SignStyle .NOT_NEGATIVE )
1145
- .appendFraction (NANO_OF_SECOND , 1 , 3 , true )
1151
+ .appendFraction (NANO_OF_SECOND , 1 , 9 , true )
1146
1152
.optionalEnd ()
1147
1153
.toFormatter (Locale .ROOT );
1148
1154
0 commit comments