/libcore/luni/src/test/java/libcore/java/time/ |
ZonedDateTimeTest.java | 20 import java.time.LocalDateTime; 47 // LocalDateTime during winter time (OFFSET_P1 in ZONE_VIENNA). 48 private static final LocalDateTime LDT_P1 = LocalDateTime.of(2000, Month.JANUARY, 1, 0, 0); 50 // LocalDateTime during summer time (OFFSET_P2 in ZONE_VIENNA). 51 private static final LocalDateTime LDT_P2 = LocalDateTime.of(2000, Month.JUNE, 1, 0, 0); 53 // LocalDateTime that is in a gap that occurs at the switch from winter time to summer time. 55 private static final LocalDateTime LDT_IN_GAP = LocalDateTime.of(2000, Month.MARCH, 26, 2, 30) [all...] |
DurationTest.java | 23 import java.time.LocalDateTime; 82 { LocalDateTime.MAX, Duration.ofNanos(1) }, 83 { LocalDateTime.now(), MAX_DURATION }, 84 { ZonedDateTime.of(LocalDateTime.MAX, ZoneOffset.UTC ), Duration.ofNanos(1) }, 109 { LocalDateTime.MIN, Duration.ofNanos(1) }, 110 { LocalDateTime.now(), MAX_DURATION }, 111 { LocalDateTime.MAX, MAX_DURATION }, 112 { ZonedDateTime.of(LocalDateTime.MIN, ZoneOffset.UTC ), Duration.ofNanos(1) },
|
OffsetDateTimeTest.java | 40 // Most of the logic is in LocalDateTime, to which OffsetDateTime#plus() delegates, verify 41 // only some simple cases here. In-depth tests for LocalDateTime#plus() can be found in
|
/libcore/luni/src/test/java/libcore/java/time/zone/ |
ZoneRulesTest.java | 21 import java.time.LocalDateTime; 48 LocalDateTime.MIN.toInstant(offset), 50 LocalDateTime.of(2000, Month.JANUARY, 1, 1, 1).toInstant(ZoneOffset.UTC), 52 LocalDateTime.MAX.toInstant(offset), 59 LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, offset); 60 assertNull(zoneRules.getTransition(localDateTime)); 62 zoneRules.getValidOffsets(localDateTime));
|
ZoneOffsetTransitionTest.java | 19 import java.time.LocalDateTime; 36 LocalDateTime time = LocalDateTime.of(2000, Month.JANUARY, 1, 0, 0);
|
IcuZoneRulesProviderTest.java | 27 import java.time.LocalDateTime; 70 LocalDateTime.of(1900, Month.DECEMBER, 24, 12, 0).toInstant(ZoneOffset.UTC), 71 LocalDateTime.of(1970, Month.JANUARY, 1, 2, 3).toInstant(ZoneOffset.UTC), 72 LocalDateTime.of(1980, Month.FEBRUARY, 4, 5, 6).toInstant(ZoneOffset.UTC), 73 LocalDateTime.of(1990, Month.MARCH, 7, 8, 9).toInstant(ZoneOffset.UTC), 74 LocalDateTime.of(2000, Month.APRIL, 10, 11, 12).toInstant(ZoneOffset.UTC), 75 LocalDateTime.of(2016, Month.MAY, 13, 14, 15).toInstant(ZoneOffset.UTC), 76 LocalDateTime.of(2020, Month.JUNE, 16, 17, 18).toInstant(ZoneOffset.UTC), 77 LocalDateTime.of(2100, Month.JULY, 19, 20, 21).toInstant(ZoneOffset.UTC), 123 final Instant start = LocalDateTime.of(1900, Month.JANUARY, 1, 12, 0 [all...] |
/libcore/ojluni/src/test/java/time/test/java/time/ |
TestLocalDateTime.java | 67 import java.time.LocalDateTime; 76 * Test LocalDateTime. 81 private LocalDateTime TEST_2007_07_15_12_30_40_987654321 = LocalDateTime.of(2007, 7, 15, 12, 30, 40, 987654321); 86 assertImmutable(LocalDateTime.class); 126 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.withYear(2007); 133 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.withMonth(7); 140 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.withDayOfMonth(15); 146 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.withDayOfYear(31 + 28 + 31 + 30 + 31 + 30 + 15); 152 LocalDateTime t = TEST_2007_07_15_12_30_40_987654321.withHour(12) [all...] |
TestZoneId.java | 71 import java.time.LocalDateTime; 236 checkOffset(test.getRules(), LocalDateTime.of(2008, 3, 30, 0, 59, 59, 999999999), ZoneOffset.ofHours(0), 1); 237 checkOffset(test.getRules(), LocalDateTime.of(2008, 3, 30, 1, 30, 0, 0), ZoneOffset.ofHours(0), GAP); 238 checkOffset(test.getRules(), LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0), ZoneOffset.ofHours(1), 1); 252 checkOffset(test.getRules(), LocalDateTime.of(2008, 10, 26, 0, 59, 59, 999999999), ZoneOffset.ofHours(1), 1); 253 checkOffset(test.getRules(), LocalDateTime.of(2008, 10, 26, 1, 30, 0, 0), ZoneOffset.ofHours(1), OVERLAP); 254 checkOffset(test.getRules(), LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0), ZoneOffset.ofHours(0), 1); 259 final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 1, 0, 0, 0); 266 assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2008, 3, 30, 1, 0)) [all...] |
/frameworks/base/services/core/java/com/android/server/twilight/ |
TwilightState.java | 22 import java.time.LocalDateTime; 51 * Returns a new {@link LocalDateTime} instance initialized to {@link #sunriseTimeMillis()}. 53 public LocalDateTime sunrise() { 55 return LocalDateTime.ofInstant(Instant.ofEpochMilli(mSunriseTimeMillis), zoneId); 67 * Returns a new {@link LocalDateTime} instance initialized to {@link #sunsetTimeMillis()}. 69 public LocalDateTime sunset() { 71 return LocalDateTime.ofInstant(Instant.ofEpochMilli(mSunsetTimeMillis), zoneId);
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
TCKLocalDateTime.java | 117 import java.time.LocalDateTime; 150 * Test LocalDateTime. 161 private LocalDateTime TEST_2007_07_15_12_30_40_987654321 = LocalDateTime.of(2007, 7, 15, 12, 30, 40, 987654321); 162 private LocalDateTime MAX_DATE_TIME; 163 private LocalDateTime MIN_DATE_TIME; 169 MAX_DATE_TIME = LocalDateTime.MAX; 170 MIN_DATE_TIME = LocalDateTime.MIN; 178 TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, } [all...] |
TCKZonedDateTime.java | 109 import java.time.LocalDateTime; 157 private LocalDateTime TEST_PARIS_GAP_2008_03_30_02_30; 158 private LocalDateTime TEST_PARIS_OVERLAP_2008_10_26_02_30; 159 private LocalDateTime TEST_LOCAL_2008_06_30_11_30_59_500; 165 TEST_LOCAL_2008_06_30_11_30_59_500 = LocalDateTime.of(2008, 6, 30, 11, 30, 59, 500); 168 TEST_PARIS_OVERLAP_2008_10_26_02_30 = LocalDateTime.of(2008, 10, 26, 2, 30); 169 TEST_PARIS_GAP_2008_03_30_02_30 = LocalDateTime.of(2008, 3, 30, 2, 30); 323 ZonedDateTime base = ZonedDateTime.of(LocalDateTime.of(1970, 1, 1, 12, 0), ZoneOffset.UTC); 389 // of(LocalDateTime, ZoneId) 393 LocalDateTime base = LocalDateTime.of(2008, 6, 30, 11, 30, 10, 500) [all...] |
/libcore/ojluni/src/test/java/time/tck/java/time/zone/ |
TCKZoneOffsetTransition.java | 66 import java.time.LocalDateTime; 96 ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), null, OFFSET_0200); 101 ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), OFFSET_0200, null); 106 ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30), OFFSET_0200, OFFSET_0200); 111 ZoneOffsetTransition.of(LocalDateTime.of(2010, 12, 3, 11, 30, 0, 500), OFFSET_0200, OFFSET_0300); 119 LocalDateTime before = LocalDateTime.of(2010, 3, 31, 1, 0); 120 LocalDateTime after = LocalDateTime.of(2010, 3, 31, 2, 0); 134 LocalDateTime before = LocalDateTime.of(2010, 10, 31, 1, 0) [all...] |
TCKZoneRules.java | 75 import java.time.LocalDateTime; 205 checkOffset(test, LocalDateTime.of(2008, 3, 30, 0, 59, 59, 999999999), OFFSET_ZERO, 1); 206 checkOffset(test, LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0), OFFSET_PONE, 1); 220 checkOffset(test, LocalDateTime.of(2008, 10, 26, 0, 59, 59, 999999999), OFFSET_PONE, 1); 221 checkOffset(test, LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0), OFFSET_ZERO, 1); 226 final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 1, 0, 0, 0); 233 assertEquals(trans.getDateTimeBefore(), LocalDateTime.of(2008, 3, 30, 1, 0)); 234 assertEquals(trans.getDateTimeAfter(), LocalDateTime.of(2008, 3, 30, 2, 0)); 251 final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 1, 0, 0, 0) [all...] |
/libcore/ojluni/src/test/java/time/tck/java/time/zone/serial/ |
TCKZoneOffsetTransitionSerialization.java | 68 import java.time.LocalDateTime; 85 LocalDateTime ldt = LocalDateTime.of(Year.MAX_VALUE, 12, 31, 1, 31, 53); 92 LocalDateTime ldt = LocalDateTime.of(Year.MIN_VALUE, 1, 1, 12, 1, 3); 99 LocalDateTime before = LocalDateTime.of(2010, 3, 31, 1, 0); 100 LocalDateTime after = LocalDateTime.of(2010, 3, 31, 2, 0); 107 LocalDateTime before = LocalDateTime.of(2010, 10, 31, 1, 0) [all...] |
/libcore/ojluni/src/main/java/java/time/ |
LocalDateTime.java | 104 * {@code LocalDateTime} is an immutable date-time object that represents a date-time, 109 * stored in a {@code LocalDateTime}. 129 public final class LocalDateTime 133 * The minimum supported {@code LocalDateTime}, '-999999999-01-01T00:00:00'. 138 public static final LocalDateTime MIN = LocalDateTime.of(LocalDate.MIN, LocalTime.MIN); 140 * The maximum supported {@code LocalDateTime}, '+999999999-12-31T23:59:59.999999999'. 145 public static final LocalDateTime MAX = LocalDateTime.of(LocalDate.MAX, LocalTime.MAX); 173 public static LocalDateTime now() [all...] |
ZonedDateTime.java | 106 * This class handles conversion from the local time-line of {@code LocalDateTime} 143 * of a {@code LocalDateTime} and a {@code ZoneId}. The {@code ZoneOffset} is 149 * a {@code LocalDateTime}, a {@code ZoneId} and the resolved {@code ZoneOffset}. 169 private final LocalDateTime dateTime; 259 return of(LocalDateTime.of(date, time), zone); 282 * @param localDateTime the local date-time, not null 286 public static ZonedDateTime of(LocalDateTime localDateTime, ZoneId zone) { 287 return ofLocal(localDateTime, zone, null); 314 * {@code LocalDateTime} has five additional convenience variants of th [all...] |
/frameworks/base/services/core/java/com/android/server/display/ |
ColorDisplayService.java | 48 import java.time.LocalDateTime; 411 * @param compareTime the LocalDateTime to compare against 412 * @return the prior LocalDateTime corresponding to this local time 414 public static LocalDateTime getDateTimeBefore(LocalTime localTime, LocalDateTime compareTime) { 415 final LocalDateTime ldt = LocalDateTime.of(compareTime.getYear(), compareTime.getMonth(), 426 * @param compareTime the LocalDateTime to compare against 427 * @return the next LocalDateTime corresponding to this local time 429 public static LocalDateTime getDateTimeAfter(LocalTime localTime, LocalDateTime compareTime) [all...] |
/packages/services/Car/tests/obd2_app/src/com/google/android/car/obd2app/ |
StatusNotification.java | 21 import java.time.LocalDateTime; 44 LocalDateTime now = LocalDateTime.now();
|
/libcore/ojluni/src/test/java/time/tck/java/time/serial/ |
TCKLocalDateTimeSerialization.java | 67 import java.time.LocalDateTime; 70 * Test serialization of LocalDateTime. 75 private LocalDateTime TEST_2007_07_15_12_30_40_987654321 = LocalDateTime.of(2007, 7, 15, 12, 30, 40, 987654321); 81 assertSerializable(LocalDateTime.MIN); 82 assertSerializable(LocalDateTime.MAX); 99 assertSerializedBySer(LocalDateTime.of(2012, 9, 16, 22, 17, 59, 459_000_000), bytes); 104 assertNotSerializable(LocalDateTime.class);
|
TCKZonedDateTimeSerialization.java | 69 import java.time.LocalDateTime; 83 private LocalDateTime TEST_LOCAL_2008_06_30_11_30_59_500; 89 TEST_LOCAL_2008_06_30_11_30_59_500 = LocalDateTime.of(2008, 6, 30, 11, 30, 59, 500); 117 ZonedDateTime zdt = LocalDateTime.of(2012, 9, 16, 22, 17, 59, 470_000_000).atZone(ZoneId.of("Europe/London")); 138 ZonedDateTime zdt = LocalDateTime.of(2012, 9, 16, 22, 17, 59, 470_000_000).atZone(ZoneOffset.ofHours(1));
|
/libcore/ojluni/src/test/java/time/tck/java/time/format/ |
TCKFormatStyle.java | 59 import java.time.LocalDateTime; 97 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), ZONEID_PARIS), FormatStyle.FULL, "Tuesday, 2 October 2001 at 01:02:03 Central European Summer Time Europe/Paris"}, 98 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), ZONEID_PARIS), FormatStyle.LONG, "2 October 2001 at 01:02:03 CEST Europe/Paris"}, 99 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), ZONEID_PARIS), FormatStyle.MEDIUM, "2 Oct 2001, 01:02:03 Europe/Paris"}, 100 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), ZONEID_PARIS), FormatStyle.SHORT, "02/10/2001, 01:02 Europe/Paris"}, 102 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), OFFSET_PTWO), FormatStyle.FULL, "Tuesday, 2 October 2001 at 01:02:03 +02:00 +02:00"}, 103 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), OFFSET_PTWO), FormatStyle.LONG, "2 October 2001 at 01:02:03 +02:00 +02:00"}, 104 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), OFFSET_PTWO), FormatStyle.MEDIUM, "2 Oct 2001, 01:02:03 +02:00"}, 105 {ZonedDateTime.of(LocalDateTime.of(2001, 10, 2, 1, 2, 3), OFFSET_PTWO), FormatStyle.SHORT, "02/10/2001, 01:02 +02:00"},
|
TCKDateTimeTextPrinting.java | 67 import java.time.LocalDateTime; 141 LocalDateTime dt = LocalDateTime.of(2010, 1, 1, 0, 0); 151 LocalDateTime dt = LocalDateTime.of(2010, 1, 1, 0, 0); 176 LocalDateTime dt = LocalDateTime.of(2010, 1, 1, 0, 0); 190 LocalDateTime dt = LocalDateTime.of(2010, 1, 1, 0, 0); 202 LocalDateTime dt = LocalDateTime.of(2010, 2, 1, 0, 0) [all...] |
/frameworks/base/core/java/android/util/ |
LocalLog.java | 21 import java.time.LocalDateTime; 43 append(String.format("%s - %s", LocalDateTime.now(), msg));
|
/libcore/ojluni/src/test/java/time/test/java/time/chrono/ |
TestChronoLocalDate.java | 63 import java.time.LocalDateTime; 186 LocalDateTime now = LocalDateTime.now(); 188 ChronoLocalDateTime<?> ldt = chrono.localDateTime(now); 193 LocalDateTime now = LocalDateTime.now(); 195 ChronoLocalDateTime<? extends ChronoLocalDate> ldt = chrono.localDateTime(now);
|
/libcore/ojluni/src/main/java/java/time/zone/ |
ZoneRules.java | 73 import java.time.LocalDateTime; 138 private final LocalDateTime[] savingsLocalTransitions; 164 private static final LocalDateTime[] EMPTY_LDT_ARRAY = new LocalDateTime[0]; 230 List<LocalDateTime> localTransitionList = new ArrayList<>(); 243 this.savingsLocalTransitions = localTransitionList.toArray(new LocalDateTime[localTransitionList.size()]); 285 List<LocalDateTime> localTransitionList = new ArrayList<>(); 298 this.savingsLocalTransitions = localTransitionList.toArray(new LocalDateTime[localTransitionList.size()]); 530 * {@link #getValidOffsets(LocalDateTime)} and {@link #getTransition(LocalDateTime)} [all...] |