Home
last modified time | relevance | path

Searched refs:ChronoUnit (Results 1 – 25 of 77) sorted by relevance

1234

/libcore/luni/src/test/java/libcore/java/time/
DInstantTest.java20 import java.time.temporal.ChronoUnit;
36 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.NANOS)); in test_isSupported_TemporalUnit()
37 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.MICROS)); in test_isSupported_TemporalUnit()
38 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.MILLIS)); in test_isSupported_TemporalUnit()
39 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.SECONDS)); in test_isSupported_TemporalUnit()
40 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.MINUTES)); in test_isSupported_TemporalUnit()
41 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.HOURS)); in test_isSupported_TemporalUnit()
42 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.HALF_DAYS)); in test_isSupported_TemporalUnit()
43 assertEquals(true, Instant.EPOCH.isSupported(ChronoUnit.DAYS)); in test_isSupported_TemporalUnit()
44 assertEquals(false, Instant.EPOCH.isSupported(ChronoUnit.WEEKS)); in test_isSupported_TemporalUnit()
[all …]
DOffsetTimeTest.java21 import java.time.temporal.ChronoUnit;
46 NOON_UTC.plus(1, ChronoUnit.HOURS)); in test_plus()
48 NOON_UTC.plus(23, ChronoUnit.HOURS)); in test_plus()
50 NOON_UTC.plus(1, ChronoUnit.MINUTES)); in test_plus()
52 NOON_UTC.plus(60, ChronoUnit.SECONDS)); in test_plus()
54 NOON_UTC.plus(1, ChronoUnit.MILLIS)); in test_plus()
56 NOON_UTC.plus(1, ChronoUnit.NANOS)); in test_plus()
61 assertPlusIsNoop(0, ChronoUnit.MINUTES); in test_plus_noop()
62 assertPlusIsNoop(2, ChronoUnit.HALF_DAYS); in test_plus_noop()
63 assertPlusIsNoop(24, ChronoUnit.HOURS); in test_plus_noop()
[all …]
DOffsetDateTimeTest.java21 import java.time.temporal.ChronoUnit;
44 ODT.plus(1, ChronoUnit.HOURS)); in test_plus()
46 ODT.plus(23, ChronoUnit.HOURS)); in test_plus()
48 ODT.plus(1, ChronoUnit.MINUTES)); in test_plus()
50 ODT.plus(60, ChronoUnit.SECONDS)); in test_plus()
52 ODT.plus(1, ChronoUnit.MILLIS)); in test_plus()
54 ODT.plus(1, ChronoUnit.NANOS)); in test_plus()
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/serial/
DTCKChronoUnitSerialization.java59 import static java.time.temporal.ChronoUnit.CENTURIES;
60 import static java.time.temporal.ChronoUnit.DAYS;
61 import static java.time.temporal.ChronoUnit.DECADES;
62 import static java.time.temporal.ChronoUnit.ERAS;
63 import static java.time.temporal.ChronoUnit.FOREVER;
64 import static java.time.temporal.ChronoUnit.HALF_DAYS;
65 import static java.time.temporal.ChronoUnit.HOURS;
66 import static java.time.temporal.ChronoUnit.MICROS;
67 import static java.time.temporal.ChronoUnit.MILLENNIA;
68 import static java.time.temporal.ChronoUnit.MILLIS;
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
DTCKChronoUnit.java59 import static java.time.temporal.ChronoUnit.CENTURIES;
60 import static java.time.temporal.ChronoUnit.DAYS;
61 import static java.time.temporal.ChronoUnit.DECADES;
62 import static java.time.temporal.ChronoUnit.ERAS;
63 import static java.time.temporal.ChronoUnit.FOREVER;
64 import static java.time.temporal.ChronoUnit.HALF_DAYS;
65 import static java.time.temporal.ChronoUnit.HOURS;
66 import static java.time.temporal.ChronoUnit.MICROS;
67 import static java.time.temporal.ChronoUnit.MILLENNIA;
68 import static java.time.temporal.ChronoUnit.MILLIS;
[all …]
DTCKChronoField.java87 import static java.time.temporal.ChronoUnit.DAYS;
88 import static java.time.temporal.ChronoUnit.FOREVER;
89 import static java.time.temporal.ChronoUnit.HOURS;
90 import static java.time.temporal.ChronoUnit.MICROS;
91 import static java.time.temporal.ChronoUnit.MILLIS;
92 import static java.time.temporal.ChronoUnit.MINUTES;
93 import static java.time.temporal.ChronoUnit.MONTHS;
94 import static java.time.temporal.ChronoUnit.NANOS;
95 import static java.time.temporal.ChronoUnit.SECONDS;
96 import static java.time.temporal.ChronoUnit.WEEKS;
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestChronoLocalDate.java69 import java.time.temporal.ChronoUnit;
89 dates.add(date.minus(10, ChronoUnit.YEARS)); in test_date_comparator_checkGenerics_ISO()
90 dates.add(date.minus(1, ChronoUnit.YEARS)); in test_date_comparator_checkGenerics_ISO()
91 dates.add(date.minus(1, ChronoUnit.MONTHS)); in test_date_comparator_checkGenerics_ISO()
92 dates.add(date.minus(1, ChronoUnit.WEEKS)); in test_date_comparator_checkGenerics_ISO()
93 dates.add(date.minus(1, ChronoUnit.DAYS)); in test_date_comparator_checkGenerics_ISO()
95 dates.add(date.plus(1, ChronoUnit.DAYS)); in test_date_comparator_checkGenerics_ISO()
96 dates.add(date.plus(1, ChronoUnit.WEEKS)); in test_date_comparator_checkGenerics_ISO()
97 dates.add(date.plus(1, ChronoUnit.MONTHS)); in test_date_comparator_checkGenerics_ISO()
98 dates.add(date.plus(1, ChronoUnit.YEARS)); in test_date_comparator_checkGenerics_ISO()
[all …]
DTestChronologyPerf.java31 import java.time.temporal.ChronoUnit;
46 Duration d = Duration.of(end - start, ChronoUnit.NANOS); in test_chronologyGetAvailablePerf()
52 d = Duration.of(end - start, ChronoUnit.NANOS); in test_chronologyGetAvailablePerf()
58 d = Duration.of(end - start, ChronoUnit.NANOS); in test_chronologyGetAvailablePerf()
DTestExampleCode.java73 import java.time.temporal.ChronoUnit;
109 .plus(1, ChronoUnit.YEARS) in test_chronoPackageExample()
110 .minus(1, ChronoUnit.DAYS); in test_chronoPackageExample()
162 .plus(1, ChronoUnit.YEARS) in test_calendarPackageExample()
163 .minus(1, ChronoUnit.DAYS); in test_calendarPackageExample()
204 return (D) date.plus(1, ChronoUnit.DAYS); in next()
216 return (ChronoLocalDateTime<D>) date.plus(1, ChronoUnit.DAYS).atTime(LocalTime.of(12, 0)); in tomorrowNoon()
/libcore/ojluni/src/main/java/java/time/temporal/
DChronoField.java70 import static java.time.temporal.ChronoUnit.DAYS;
71 import static java.time.temporal.ChronoUnit.ERAS;
72 import static java.time.temporal.ChronoUnit.FOREVER;
73 import static java.time.temporal.ChronoUnit.HALF_DAYS;
74 import static java.time.temporal.ChronoUnit.HOURS;
75 import static java.time.temporal.ChronoUnit.MICROS;
76 import static java.time.temporal.ChronoUnit.MILLIS;
77 import static java.time.temporal.ChronoUnit.MINUTES;
78 import static java.time.temporal.ChronoUnit.MONTHS;
79 import static java.time.temporal.ChronoUnit.NANOS;
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKYear.java65 import static java.time.temporal.ChronoUnit.CENTURIES;
66 import static java.time.temporal.ChronoUnit.DAYS;
67 import static java.time.temporal.ChronoUnit.DECADES;
68 import static java.time.temporal.ChronoUnit.MILLENNIA;
69 import static java.time.temporal.ChronoUnit.MONTHS;
70 import static java.time.temporal.ChronoUnit.YEARS;
96 import java.time.temporal.ChronoUnit;
374 assertEquals(TEST_2008.isSupported(ChronoUnit.NANOS), false); in test_isSupported_TemporalUnit()
375 assertEquals(TEST_2008.isSupported(ChronoUnit.MICROS), false); in test_isSupported_TemporalUnit()
376 assertEquals(TEST_2008.isSupported(ChronoUnit.MILLIS), false); in test_isSupported_TemporalUnit()
[all …]
DTCKYearMonth.java67 import static java.time.temporal.ChronoUnit.CENTURIES;
68 import static java.time.temporal.ChronoUnit.DAYS;
69 import static java.time.temporal.ChronoUnit.DECADES;
70 import static java.time.temporal.ChronoUnit.HOURS;
71 import static java.time.temporal.ChronoUnit.MILLENNIA;
72 import static java.time.temporal.ChronoUnit.MONTHS;
73 import static java.time.temporal.ChronoUnit.YEARS;
98 import java.time.temporal.ChronoUnit;
439 assertEquals(TEST_2008_06.isSupported(ChronoUnit.NANOS), false); in test_isSupported_TemporalUnit()
440 assertEquals(TEST_2008_06.isSupported(ChronoUnit.MICROS), false); in test_isSupported_TemporalUnit()
[all …]
DTCKLocalDate.java75 import static java.time.temporal.ChronoUnit.CENTURIES;
76 import static java.time.temporal.ChronoUnit.DAYS;
77 import static java.time.temporal.ChronoUnit.DECADES;
78 import static java.time.temporal.ChronoUnit.HOURS;
79 import static java.time.temporal.ChronoUnit.MILLENNIA;
80 import static java.time.temporal.ChronoUnit.MONTHS;
81 import static java.time.temporal.ChronoUnit.WEEKS;
82 import static java.time.temporal.ChronoUnit.YEARS;
110 import java.time.temporal.ChronoUnit;
648 assertEquals(TEST_2007_07_15.isSupported(ChronoUnit.NANOS), false);
[all …]
DMockSimplePeriod.java62 import static java.time.temporal.ChronoUnit.DAYS;
63 import static java.time.temporal.ChronoUnit.FOREVER;
64 import static java.time.temporal.ChronoUnit.SECONDS;
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DTCKChronoLocalDateTime.java79 import java.time.temporal.ChronoUnit;
267 dates.add(date.minus(1, ChronoUnit.YEARS)); in test_datetime_comparisons()
268 dates.add(date.minus(1, ChronoUnit.MONTHS)); in test_datetime_comparisons()
269 dates.add(date.minus(1, ChronoUnit.WEEKS)); in test_datetime_comparisons()
270 dates.add(date.minus(1, ChronoUnit.DAYS)); in test_datetime_comparisons()
271 dates.add(date.minus(1, ChronoUnit.HOURS)); in test_datetime_comparisons()
272 dates.add(date.minus(1, ChronoUnit.MINUTES)); in test_datetime_comparisons()
273 dates.add(date.minus(1, ChronoUnit.SECONDS)); in test_datetime_comparisons()
274 dates.add(date.minus(1, ChronoUnit.NANOS)); in test_datetime_comparisons()
276 dates.add(date.plus(1, ChronoUnit.NANOS)); in test_datetime_comparisons()
[all …]
DTCKChronoZonedDateTime.java80 import java.time.temporal.ChronoUnit;
270 dates.add(date.minus(1, ChronoUnit.YEARS)); in test_zonedDateTime_comparisons()
271 dates.add(date.minus(1, ChronoUnit.MONTHS)); in test_zonedDateTime_comparisons()
272 dates.add(date.minus(1, ChronoUnit.WEEKS)); in test_zonedDateTime_comparisons()
273 dates.add(date.minus(1, ChronoUnit.DAYS)); in test_zonedDateTime_comparisons()
274 dates.add(date.minus(1, ChronoUnit.HOURS)); in test_zonedDateTime_comparisons()
275 dates.add(date.minus(1, ChronoUnit.MINUTES)); in test_zonedDateTime_comparisons()
276 dates.add(date.minus(1, ChronoUnit.SECONDS)); in test_zonedDateTime_comparisons()
277 dates.add(date.minus(1, ChronoUnit.NANOS)); in test_zonedDateTime_comparisons()
279 dates.add(date.plus(1, ChronoUnit.NANOS)); in test_zonedDateTime_comparisons()
[all …]
DTCKChronoLocalDate.java78 import java.time.temporal.ChronoUnit;
264 dates.add(date.minus(1, ChronoUnit.YEARS)); in test_date_comparisons()
265 dates.add(date.minus(1, ChronoUnit.MONTHS)); in test_date_comparisons()
266 dates.add(date.minus(1, ChronoUnit.WEEKS)); in test_date_comparisons()
267 dates.add(date.minus(1, ChronoUnit.DAYS)); in test_date_comparisons()
269 dates.add(date.plus(1, ChronoUnit.DAYS)); in test_date_comparisons()
270 dates.add(date.plus(1, ChronoUnit.WEEKS)); in test_date_comparisons()
271 dates.add(date.plus(1, ChronoUnit.MONTHS)); in test_date_comparisons()
272 dates.add(date.plus(1, ChronoUnit.YEARS)); in test_date_comparisons()
/libcore/ojluni/src/main/java/java/time/
DYear.java67 import static java.time.temporal.ChronoUnit.CENTURIES;
68 import static java.time.temporal.ChronoUnit.DECADES;
69 import static java.time.temporal.ChronoUnit.ERAS;
70 import static java.time.temporal.ChronoUnit.MILLENNIA;
71 import static java.time.temporal.ChronoUnit.YEARS;
86 import java.time.temporal.ChronoUnit;
397 if (unit instanceof ChronoUnit) { in isSupported()
703 if (unit instanceof ChronoUnit) { in plus()
704 switch ((ChronoUnit) unit) { in plus()
909 if (unit instanceof ChronoUnit) { in until()
[all …]
DYearMonth.java69 import static java.time.temporal.ChronoUnit.CENTURIES;
70 import static java.time.temporal.ChronoUnit.DECADES;
71 import static java.time.temporal.ChronoUnit.ERAS;
72 import static java.time.temporal.ChronoUnit.MILLENNIA;
73 import static java.time.temporal.ChronoUnit.MONTHS;
74 import static java.time.temporal.ChronoUnit.YEARS;
89 import java.time.temporal.ChronoUnit;
385 if (unit instanceof ChronoUnit) { in isSupported()
800 if (unit instanceof ChronoUnit) { in plus()
801 switch ((ChronoUnit) unit) { in plus()
[all …]
DPeriod.java64 import static java.time.temporal.ChronoUnit.DAYS;
65 import static java.time.temporal.ChronoUnit.MONTHS;
66 import static java.time.temporal.ChronoUnit.YEARS;
79 import java.time.temporal.ChronoUnit;
269 if (unit == ChronoUnit.YEARS) { in from()
271 } else if (unit == ChronoUnit.MONTHS) { in from()
273 } else if (unit == ChronoUnit.DAYS) { in from()
427 if (unit == ChronoUnit.YEARS) { in get()
429 } else if (unit == ChronoUnit.MONTHS) { in get()
431 } else if (unit == ChronoUnit.DAYS) { in get()
DInstant.java72 import static java.time.temporal.ChronoUnit.DAYS;
73 import static java.time.temporal.ChronoUnit.NANOS;
84 import java.time.temporal.ChronoUnit;
489 if (unit instanceof ChronoUnit) { in isSupported()
743 if (unit == ChronoUnit.NANOS) { in truncatedTo()
845 if (unit instanceof ChronoUnit) { in plus()
846 switch ((ChronoUnit) unit) { in plus()
1139 if (unit instanceof ChronoUnit) { in until()
1140 ChronoUnit f = (ChronoUnit) unit; in until()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoLocalDateTimeImpl.java75 import java.time.temporal.ChronoUnit;
305 if (unit instanceof ChronoUnit) { in plus()
306 ChronoUnit f = (ChronoUnit) unit; in plus()
322 return with(date.plus(days, ChronoUnit.DAYS), time); in plusDays()
360 return with(newDate.plus(totDays, ChronoUnit.DAYS), newTime); in plusWithOverflow()
375 if (unit instanceof ChronoUnit) { in until()
378 switch ((ChronoUnit) unit) { in until()
391 endDate = endDate.minus(1, ChronoUnit.DAYS); in until()
DChronoLocalDateImpl.java67 import java.time.temporal.ChronoUnit;
199 if (unit instanceof ChronoUnit) { in plus()
200 ChronoUnit f = (ChronoUnit) unit; in plus()
379 if (unit instanceof ChronoUnit) { in until()
380 switch ((ChronoUnit) unit) { in until()
DChronoPeriodImpl.java60 import static java.time.temporal.ChronoUnit.DAYS;
61 import static java.time.temporal.ChronoUnit.MONTHS;
62 import static java.time.temporal.ChronoUnit.YEARS;
72 import java.time.temporal.ChronoUnit;
142 if (unit == ChronoUnit.YEARS) { in get()
144 } else if (unit == ChronoUnit.MONTHS) { in get()
146 } else if (unit == ChronoUnit.DAYS) { in get()
/libcore/ojluni/src/test/java/time/test/java/time/
DMockSimplePeriod.java62 import static java.time.temporal.ChronoUnit.DAYS;
63 import static java.time.temporal.ChronoUnit.FOREVER;
64 import static java.time.temporal.ChronoUnit.SECONDS;

1234