Home
last modified time | relevance | path

Searched refs:DateTimeFormatter (Results 1 – 25 of 65) sorted by relevance

123

/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestDateTimeParsing.java77 import java.time.format.DateTimeFormatter;
93 private static final DateTimeFormatter LOCALFIELDS = new DateTimeFormatterBuilder()
95 private static final DateTimeFormatter LOCALFIELDS_ZONEID = new DateTimeFormatterBuilder()
97 private static final DateTimeFormatter LOCALFIELDS_OFFSETID = new DateTimeFormatterBuilder()
99 private static final DateTimeFormatter LOCALFIELDS_WITH_PARIS = LOCALFIELDS.withZone(PARIS);
100 … private static final DateTimeFormatter LOCALFIELDS_WITH_0230 = LOCALFIELDS.withZone(OFFSET_0230);
101 private static final DateTimeFormatter INSTANT = new DateTimeFormatterBuilder()
103 private static final DateTimeFormatter INSTANT_WITH_PARIS = INSTANT.withZone(PARIS);
104 private static final DateTimeFormatter INSTANT_WITH_0230 = INSTANT.withZone(OFFSET_0230);
105 private static final DateTimeFormatter INSTANT_OFFSETID = new DateTimeFormatterBuilder()
[all …]
DTestDateTimeFormatter.java83 import java.time.format.DateTimeFormatter;
101 DateTimeFormatter base = in test_withLocale_same()
106 DateTimeFormatter test = base.withLocale(Locale.ENGLISH); in test_withLocale_same()
145 DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-mm-dd"); in assertGoodErrorDate()
160 DateTimeFormatter f = DateTimeFormatter.ofPattern("HH:MM:ss"); in assertGoodErrorTime()
176 DateTimeFormatter f = DateTimeFormatter.ofPattern("HH:mm:ss"); in test_parsed_toString_resolvedTime()
184 DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-dd"); in test_parsed_toString_resolvedDate()
192 DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); in test_parsed_toString_resolvedDateTime()
DAbstractTestPrinterParser.java67 import java.time.format.DateTimeFormatter;
116 protected DateTimeFormatter getFormatter() { in getFormatter()
120 protected DateTimeFormatter getFormatter(char c) { in getFormatter()
124 protected DateTimeFormatter getFormatter(String s) { in getFormatter()
128 protected DateTimeFormatter getFormatter(TemporalField field) { in getFormatter()
132 protected DateTimeFormatter getFormatter(TemporalField field, TextStyle style) { in getFormatter()
136 …protected DateTimeFormatter getFormatter(TemporalField field, int minWidth, int maxWidth, SignStyl… in getFormatter()
140 protected DateTimeFormatter getFormatter(String pattern, String noOffsetText) { in getFormatter()
144 protected DateTimeFormatter getPatternFormatter(String pattern) { in getPatternFormatter()
DTestDateTimeFormatterBuilder.java78 import java.time.format.DateTimeFormatter;
109 DateTimeFormatter f = builder.toFormatter(); in test_toFormatter_empty()
117 DateTimeFormatter f = builder.toFormatter(); in test_parseCaseSensitive()
124 DateTimeFormatter f = builder.toFormatter(); in test_parseCaseInsensitive()
132 DateTimeFormatter f = builder.toFormatter(); in test_parseStrict()
139 DateTimeFormatter f = builder.toFormatter(); in test_parseLenient()
147 DateTimeFormatter f = builder.toFormatter(); in test_appendValue_1arg()
160 DateTimeFormatter f = builder.toFormatter(); in test_appendValue_2arg()
183 DateTimeFormatter f = builder.toFormatter(); in test_appendValue_3arg()
226 DateTimeFormatter f = builder.toFormatter(); in test_appendValue_subsequent2_parse3()
[all …]
DTestNonIsoFormatter.java43 import java.time.format.DateTimeFormatter;
160 DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) in test_formatLocalizedDate()
170 DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) in test_parseLocalizedText()
180 DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) in test_parseInvalidText()
187 DateTimeFormatter dtf = new DateTimeFormatterBuilder().appendChronologyText(TextStyle.SHORT) in test_chronoNames()
199 DateTimeFormatter dtf = new DateTimeFormatterBuilder() in test_lenientEraYear()
203 DateTimeFormatter dtfLenient = dtf.withResolverStyle(ResolverStyle.LENIENT); in test_lenientEraYear()
DTestReducedPrinter.java69 import java.time.format.DateTimeFormatter;
83 private DateTimeFormatter getFormatter0(TemporalField field, int width, int baseValue) { in getFormatter0()
87 …private DateTimeFormatter getFormatter0(TemporalField field, int minWidth, int maxWidth, int baseV… in getFormatter0()
91 …private DateTimeFormatter getFormatterBaseDate(TemporalField field, int minWidth, int maxWidth, in… in getFormatterBaseDate()
215 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 2, 2021); in test_minguoChrono_fixedWidth()
232 DateTimeFormatter f = getFormatterBaseDate(YEAR, 2, 4, 2021); in test_minguoChrono_extendedWidth()
272 DateTimeFormatter dtf = builder.toFormatter(); in test_printAdjacent()
DTestZoneTextPrinterParser.java32 import java.time.format.DateTimeFormatter;
62 protected static DateTimeFormatter getFormatter(Locale locale, TextStyle style) { in getFormatter()
205 DateTimeFormatter fmt = new DateTimeFormatterBuilder().appendZoneText(style, preferred) in test_ParseText()
223 DateTimeFormatter fmt = getFormatter(locale, style, ci); in parseText()
239 private void parse(DateTimeFormatter fmt, in parse()
261 private DateTimeFormatter getFormatter(Locale locale, TextStyle style, boolean ci) { in getFormatter()
DTestReducedParser.java82 import java.time.format.DateTimeFormatter;
99 private DateTimeFormatter getFormatter0(TemporalField field, int width, int baseValue) { in getFormatter0()
103 …private DateTimeFormatter getFormatter0(TemporalField field, int minWidth, int maxWidth, int baseV… in getFormatter0()
107 …private DateTimeFormatter getFormatterBaseDate(TemporalField field, int minWidth, int maxWidth, in… in getFormatterBaseDate()
372 DateTimeFormatter dtf = builder.toFormatter(); in test_parseAdjacent()
414 DateTimeFormatter df in test_reducedWithChronoYear()
432 DateTimeFormatter df in test_reducedWithChronoYearOfEra()
451 DateTimeFormatter df in test_reducedWithLateChronoChange()
473 DateTimeFormatter df in test_reducedWithLateChronoChangeTwice()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeFormatter.java94 import java.time.format.DateTimeFormatter;
122 private static final DateTimeFormatter BASIC_FORMATTER = DateTimeFormatter.ofPattern("'ONE'd");
123 …private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("'ONE'yyyy MM …
125 private DateTimeFormatter fmt;
137DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale()
138 DateTimeFormatter test = base.withLocale(Locale.GERMAN); in test_withLocale()
144DateTimeFormatter base = fmt.withLocale(Locale.ENGLISH).withDecimalStyle(DecimalStyle.STANDARD); in test_withLocale_null()
151 DateTimeFormatter test = fmt; in test_withChronology()
162 DateTimeFormatter test = fmt; in test_withZone()
175 DateTimeFormatter base = new DateTimeFormatterBuilder() in test_resolverFields_selectOneDateResolveYMD()
[all …]
DTCKInstantPrinterParser.java70 import java.time.format.DateTimeFormatter;
113 DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant().toFormatter(); in test_print_grouped()
191DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant(fractionalDigits).toFormatter(); in test_print_digits()
227 DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant(-1).toFormatter(); in test_parse_digitsMinusOne()
229 assertEquals(f.parse(input).query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_digitsMinusOne()
230 assertEquals(f.parse(input).query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE); in test_parse_digitsMinusOne()
235 DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant(9).toFormatter(); in test_parse_digitsNine()
239 assertEquals(f.parse(input).query(DateTimeFormatter.parsedExcessDays()), Period.ZERO); in test_parse_digitsNine()
240 assertEquals(f.parse(input).query(DateTimeFormatter.parsedLeapSecond()), Boolean.FALSE); in test_parse_digitsNine()
254 DateTimeFormatter f = new DateTimeFormatterBuilder().appendInstant(-1).toFormatter(); in test_parse_endOfDay()
[all …]
DTCKDateTimeFormatters.java89 import java.time.format.DateTimeFormatter;
121 DateTimeFormatter.ISO_DATE.format((TemporalAccessor) null); in test_format_nullTemporalAccessor()
129 DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy"); in test_pattern_String()
138 DateTimeFormatter.ofPattern("p"); in test_pattern_String_invalid()
143 DateTimeFormatter.ofPattern(null); in test_pattern_String_null()
151 DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy", Locale.UK); in test_pattern_StringLocale()
158 DateTimeFormatter.ofPattern("p", Locale.UK); in test_pattern_StringLocale_invalid()
163 DateTimeFormatter.ofPattern(null, Locale.UK); in test_pattern_StringLocale_nullPattern()
168 DateTimeFormatter.ofPattern("yyyy", null); in test_pattern_StringLocale_nullLocale()
176 …assertEquals(DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL).getChronology(), IsoChronology.IN… in test_ofLocalizedDate_basics()
[all …]
DTCKDateTimeParseResolver.java112 import java.time.format.DateTimeFormatter;
154 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); in test_resolveOneNoChange()
191 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_resolveTwoNoChange()
222 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_resolveThreeNoChange()
259 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); in test_resolveOneToField()
285 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); in test_resolveOneToDate()
310 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field1).toFormatter(); in test_resolveOneToTime()
339 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_resolveTwoToField()
387 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_resolveTwoToDate()
474 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_resolveTwoToTime()
[all …]
DTCKDateTimeFormatterBuilder.java74 import java.time.format.DateTimeFormatter;
104 DateTimeFormatter f = builder.toFormatter(); in test_toFormatter_empty()
111 DateTimeFormatter f = builder in test_parseDefaulting_entireDate()
120 DateTimeFormatter f = builder in test_parseDefaulting_yearOptionalMonthOptionalDay()
383 DateTimeFormatter f = builder.toFormatter(); in test_appendOffset_format()
391 DateTimeFormatter f = builder.toFormatter(); in test_appendOffset_parse()
726 DateTimeFormatter f = builder.appendPattern(input).toFormatter(Locale.UK); in test_appendPattern_patternPrint()
739DateTimeFormatter f = builder.appendValue(HOUR_OF_DAY, 2).appendValue(MINUTE_OF_HOUR, 2).appendLit… in test_adjacent_strict_firstFixedWidth()
751DateTimeFormatter f = builder.appendValue(HOUR_OF_DAY).appendValue(MINUTE_OF_HOUR, 2).appendLitera… in test_adjacent_strict_firstVariableWidth_success()
763DateTimeFormatter f = builder.appendValue(HOUR_OF_DAY).appendValue(MINUTE_OF_HOUR, 2).appendLitera… in test_adjacent_strict_firstVariableWidth_fails()
[all …]
DTCKDateTimeTextPrinting.java69 import java.time.format.DateTimeFormatter;
140 DateTimeFormatter f = builder.appendText(field, style).toFormatter(Locale.ENGLISH); in test_appendText2arg_format()
150 DateTimeFormatter f = builder.appendText(field).toFormatter(Locale.ENGLISH); in test_appendText1arg_format()
175 DateTimeFormatter f = builder.toFormatter(); in test_appendTextMap()
189 DateTimeFormatter f = builder.toFormatter(); in test_appendTextMap_DOM()
201 DateTimeFormatter f = builder.toFormatter(); in test_appendTextMapIncomplete()
DTCKLocalizedFieldPrinter.java65 import java.time.format.DateTimeFormatter;
124 DateTimeFormatter dtf = DateTimeFormatter.ofPattern(pattern, locale); in test_print_WeekBasedYear()
DTCKResolverStyle.java63 import java.time.format.DateTimeFormatter;
121DateTimeFormatter optionalFormatter = new DateTimeFormatterBuilder().appendLiteral(" ").appendText… in test_resolverStyle()
123 DateTimeFormatter formatter = builder.appendOptional(optionalFormatter).toFormatter(); in test_resolverStyle()
DTCKLocalizedFieldParser.java67 import java.time.format.DateTimeFormatter;
120 DateTimeFormatter dtf = b.toFormatter(locale); in test_parse_textField()
152 DateTimeFormatter dtf = b.toFormatter(locale); in test_parse_textLocalDate()
189 DateTimeFormatter dtf = b.toFormatter(locale); in test_parse_WeekBasedYear()
DTCKLocalizedPrinterParser.java68 import java.time.format.DateTimeFormatter;
149 DateTimeFormatter f = builder.appendLocalized(dateStyle, null).toFormatter(locale); in test_date_print()
161 DateTimeFormatter f = builder.appendLocalized(dateStyle, null).toFormatter(locale); in test_date_parse()
202 DateTimeFormatter f = builder.appendLocalized(null, timeStyle).toFormatter(locale); in test_time_print()
214 DateTimeFormatter f = builder.appendLocalized(null, timeStyle).toFormatter(locale); in test_time_parse()
/libcore/ojluni/src/main/java/java/time/format/
DDateTimeFormatter.java483 public final class DateTimeFormatter { class
535 public static DateTimeFormatter ofPattern(String pattern) { in ofPattern()
559 public static DateTimeFormatter ofPattern(String pattern, Locale locale) { in ofPattern()
586 public static DateTimeFormatter ofLocalizedDate(FormatStyle dateStyle) { in ofLocalizedDate()
614 public static DateTimeFormatter ofLocalizedTime(FormatStyle timeStyle) { in ofLocalizedTime()
642 public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateTimeStyle) { in ofLocalizedDateTime()
671 …public static DateTimeFormatter ofLocalizedDateTime(FormatStyle dateStyle, FormatStyle timeStyle) { in ofLocalizedDateTime()
702 public static final DateTimeFormatter ISO_LOCAL_DATE;
732 public static final DateTimeFormatter ISO_OFFSET_DATE;
764 public static final DateTimeFormatter ISO_DATE;
[all …]
/libcore/luni/src/test/java/libcore/java/time/format/
DDateTimeFormatterTest.java25 import java.time.format.DateTimeFormatter;
48 DateTimeFormatter[] formatters = new DateTimeFormatter[] { in test_getDecimalStyle()
49 DateTimeFormatter.ISO_DATE, in test_getDecimalStyle()
50 DateTimeFormatter.RFC_1123_DATE_TIME, in test_getDecimalStyle()
61 for (DateTimeFormatter formatter : formatters) { in test_getDecimalStyle()
65 DateTimeFormatter arStyleFormatter = formatter.withDecimalStyle(arDecimalStyle); in test_getDecimalStyle()
92 return DateTimeFormatter.ofPattern(pattern, l).format(datetime); in formatWithPattern()
101 DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT) in test_format_locale_my_MM()
DDateTimeFormatterBuilderTest.java26 import java.time.format.DateTimeFormatter;
44 DateTimeFormatter formatter = new DateTimeFormatterBuilder() in test_append_DateTimeFormatter()
45 .appendLiteral('<').append(DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral('>') in test_append_DateTimeFormatter()
52 DateTimeFormatter formatter = in test_appendZoneRegionId_format()
63 DateTimeFormatter formatter = in test_appendZoneRegionId_format_offset()
75 DateTimeFormatter formatter = new DateTimeFormatterBuilder().appendZoneRegionId() in test_appendZoneRegionId_parse()
/libcore/luni/src/test/java/libcore/highmemorytest/java/time/format/
DDateTimeFormatterTest.java25 import java.time.format.DateTimeFormatter;
60 DateTimeFormatter.ofLocalizedTime(formatStyle) in test_format_allLocales()
65 DateTimeFormatter.ofLocalizedDate(formatStyle) in test_format_allLocales()
70 DateTimeFormatter.ofLocalizedDateTime(formatStyle) in test_format_allLocales()
89 DateTimeFormatter.ofLocalizedTime(formatStyle) in test_format_allLocales_allChronologies()
95 DateTimeFormatter.ofLocalizedDate(formatStyle) in test_format_allLocales_allChronologies()
101 DateTimeFormatter.ofLocalizedDateTime(formatStyle) in test_format_allLocales_allChronologies()
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
DTCKIsoFields.java74 import java.time.format.DateTimeFormatter;
153 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_quarters()
164 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_quarters_SMART()
175 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_quarters_LENIENT()
210 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_parseLenientQuarter_STRICT()
220 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_parseLenientQuarter_SMART()
240 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_parseLenientQuarter_LENIENT()
352 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_weeks_STRICT()
363 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_weeks_SMART()
374 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_weeks_LENIENT()
[all …]
DTCKJulianFields.java66 import java.time.format.DateTimeFormatter;
144 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field) in test_samples_parse_STRICT()
152 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field) in test_samples_parse_SMART()
160 DateTimeFormatter f = new DateTimeFormatterBuilder().appendValue(field) in test_samples_parse_LENIENT()
DTCKWeekFields.java77 import java.time.format.DateTimeFormatter;
385 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWom()
406 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWom_lenient()
427 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWom_strict()
453 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWomDow()
475 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWomDow_lenient()
500 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWoy()
520 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWoy_lenient()
540 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWoy_strict()
564 DateTimeFormatter f = new DateTimeFormatterBuilder() in test_parse_resolve_localizedWoyDow()
[all …]

123