Home
last modified time | relevance | path

Searched refs:now (Results 1 – 25 of 85) sorted by relevance

1234

/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DTimestampTest.java39 private Date now = new Date(); field in TimestampTest
53 new Timestamp(now, null); in testTimestamp()
59 Timestamp timestamp = new Timestamp(now, cpath); in testTimestamp()
60 assertEquals("not expected value", now, timestamp.getTimestamp()); in testTimestamp()
68 Timestamp one = new Timestamp(now, cpath); in testEqualsObject()
69 Timestamp two = new Timestamp(now, cpath); in testEqualsObject()
83 assertSame(new Timestamp(now, cpath).getSignerCertPath(), cpath); in testGetSignerCertPath()
87 Timestamp t = new Timestamp(now, cpath); in testGetTimestamp()
88 assertEquals(now, t.getTimestamp()); in testGetTimestamp()
89 assertNotSame(now, t.getTimestamp()); in testGetTimestamp()
[all …]
/libcore/ojluni/src/test/java/nio/file/attribute/
DFileTimeTest.java49 long now = System.currentTimeMillis(); in main() local
50 long tomorrowInDays = TimeUnit.DAYS.convert(now, MILLISECONDS) + 1; in main()
51 long yesterdayInDays = TimeUnit.DAYS.convert(now, MILLISECONDS) - 1; in main()
53 Instant nowInstant = Instant.ofEpochMilli(now); in main()
56 eq(now, MILLISECONDS, now, MILLISECONDS); in main()
57 eq(now, MILLISECONDS, now*1000L, MICROSECONDS); in main()
58 neq(now, MILLISECONDS, 0, MILLISECONDS); in main()
59 neq(now, MILLISECONDS, 0, MICROSECONDS); in main()
61 eq(nowInstant, now, MILLISECONDS); in main()
62 eq(nowInstant, now*1000L, MICROSECONDS); in main()
[all …]
DBasicFileAttributeViewCreationTimeTest.java71 Instant now = Instant.now(); in test() local
72 if (Math.abs(creationTime.toMillis()-now.toEpochMilli()) > 10000L) { in test()
74 throw new RuntimeException("Expected to be close to: " + now); in test()
101 Instant plusHour = Instant.now().plusSeconds(60L * 60L); in test()
114 Instant minusHour = Instant.now().minusSeconds(60L * 60L); in test()
/libcore/luni/src/test/java/libcore/libcore/icu/
DRelativeDateTimeFormatterTest.java361 final long now = cal.getTimeInMillis(); in test_getRelativeTimeSpanStringGerman() local
365 now - 42 * MINUTE_IN_MILLIS, now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman()
368 now + 42 * MINUTE_IN_MILLIS, now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman()
371 now - DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman()
374 now - 2 * DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman()
377 now + DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman()
380 now + 2 * DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman()
389 final long now = cal.getTimeInMillis(); in test_getRelativeTimeSpanStringFrench() local
393 now - (42 * MINUTE_IN_MILLIS), now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench()
396 now + (42 * MINUTE_IN_MILLIS), now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench()
[all …]
/libcore/luni/src/main/java/libcore/icu/
DRelativeDateTimeFormatter.java96 long now, long minResolution, int flags) { in getRelativeTimeSpanString() argument
100 return getRelativeTimeSpanString(locale, tz, time, now, minResolution, flags, displayContext); in getRelativeTimeSpanString()
104 long now, long minResolution, int flags, DisplayContext displayContext) { in getRelativeTimeSpanString() argument
113 return getRelativeTimeSpanString(icuLocale, icuTimeZone, time, now, minResolution, flags, in getRelativeTimeSpanString()
118 android.icu.util.TimeZone icuTimeZone, long time, long now, long minResolution, int flags, in getRelativeTimeSpanString() argument
121 long duration = Math.abs(now - time); in getRelativeTimeSpanString()
122 boolean past = (now >= time); in getRelativeTimeSpanString()
159 count = Math.abs(dayDistance(icuTimeZone, time, now)); in getRelativeTimeSpanString()
213 Calendar nowCalendar = DateUtilsBridge.createIcuCalendar(icuTimeZone, icuLocale, now); in getRelativeTimeSpanString()
266 long now, long minResolution, long transitionResolution, int flags) { in getRelativeDateTimeString() argument
[all …]
DDateUtilsBridge.java183 Calendar now = (Calendar) c.clone(); in isThisYear() local
184 now.setTimeInMillis(System.currentTimeMillis()); in isThisYear()
185 return c.get(Calendar.YEAR) == now.get(Calendar.YEAR); in isThisYear()
/libcore/ojluni/src/main/native/
DPollArrayWrapper.c44 jlong start, now; in ipoll() local
57 now = t.tv_sec * 1000 + t.tv_usec / 1000; in ipoll()
58 diff = now - start; in ipoll()
63 start = now; in ipoll()
/libcore/luni/src/main/native/
Dlibcore_icu_TimeZoneNames.cpp59 const UDate now(icu::Calendar::getNow()); in TimeZoneNames_fillZoneStrings() local
81 names->getDisplayName(lookup_id, UTZNM_LONG_STANDARD, now, long_std); in TimeZoneNames_fillZoneStrings()
83 names->getDisplayName(lookup_id, UTZNM_SHORT_STANDARD, now, short_std); in TimeZoneNames_fillZoneStrings()
85 names->getDisplayName(lookup_id, UTZNM_LONG_DAYLIGHT, now, long_dst); in TimeZoneNames_fillZoneStrings()
87 names->getDisplayName(lookup_id, UTZNM_SHORT_DAYLIGHT, now, short_dst); in TimeZoneNames_fillZoneStrings()
/libcore/ojluni/src/main/java/java/time/
DMonthDay.java159 public static MonthDay now() { in now() method in MonthDay
160 return now(Clock.systemDefaultZone()); in now()
175 public static MonthDay now(ZoneId zone) { in now() method in MonthDay
176 return now(Clock.system(zone)); in now()
189 public static MonthDay now(Clock clock) { in now() method in MonthDay
190 final LocalDate now = LocalDate.now(clock); // called once in now() local
191 return MonthDay.of(now.getMonth(), now.getDayOfMonth()); in now()
DYear.java169 public static Year now() { in now() method in Year
170 return now(Clock.systemDefaultZone()); in now()
185 public static Year now(ZoneId zone) { in now() method in Year
186 return now(Clock.system(zone)); in now()
199 public static Year now(Clock clock) { in now() method in Year
200 final LocalDate now = LocalDate.now(clock); // called once in now() local
201 return Year.of(now.getYear()); in now()
DYearMonth.java162 public static YearMonth now() { in now() method in YearMonth
163 return now(Clock.systemDefaultZone()); in now()
178 public static YearMonth now(ZoneId zone) { in now() method in YearMonth
179 return now(Clock.system(zone)); in now()
192 public static YearMonth now(Clock clock) { in now() method in YearMonth
193 final LocalDate now = LocalDate.now(clock); // called once in now() local
194 return YearMonth.of(now.getYear(), now.getMonth()); in now()
DOffsetTime.java159 public static OffsetTime now() { in now() method in OffsetTime
160 return now(Clock.systemDefaultZone()); in now()
176 public static OffsetTime now(ZoneId zone) { in now() method in OffsetTime
177 return now(Clock.system(zone)); in now()
192 public static OffsetTime now(Clock clock) { in now() method in OffsetTime
194 final Instant now = clock.instant(); // called once in now() local
195 return ofInstant(now, clock.getZone().getRules().getOffset(now)); in now()
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestChronoLocalDate.java146 date = ThaiBuddhistDate.now();
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/sun/security/x509/
DPrivateKeyUsageExtension.java195 Date now = new Date(); in valid() local
196 valid(now); in valid()
208 public void valid(Date now) in valid() argument
210 Objects.requireNonNull(now); in valid()
216 if (notBefore != null && notBefore.after(now)) { in valid()
220 if (notAfter != null && notAfter.before(now)) { in valid()
DCertificateValidity.java246 Date now = new Date(); in valid() local
247 valid(now); in valid()
261 public void valid(Date now) in valid() argument
268 if (notBefore.after(now)) { in valid()
272 if (notAfter.before(now)) { in valid()
/libcore/luni/src/test/java/libcore/java/time/
DDurationTest.java83 { LocalDateTime.now(), MAX_DURATION }, in test_addTo_exceeds()
110 { LocalDateTime.now(), MAX_DURATION }, in test_subtractFrom_exceeds()
132 Year.now(), in test_addTo_subtractFrom_unsupported()
133 YearMonth.now(), in test_addTo_subtractFrom_unsupported()
134 LocalDate.now(), in test_addTo_subtractFrom_unsupported()
/libcore/ojluni/src/test/java/time/test/java/time/
DTestLocalTime.java189 public void now() { in now() method in TestLocalTime
192 LocalTime.now(Clock.systemDefaultZone()); in now()
196 LocalTime expected = LocalTime.now(Clock.systemDefaultZone()); in now()
197 LocalTime test = LocalTime.now(); in now()
/libcore/luni/src/test/java/libcore/java/time/format/
DDateTimeFormatterBuilderTest.java56 formatter.format(ZonedDateTime.now(ZoneId.of("Europe/London")))); in test_appendZoneRegionId_format()
58 formatter.format(ZonedDateTime.now(ZoneId.of("UTC")))); in test_appendZoneRegionId_format()
67 formatter.format(OffsetDateTime.now(ZoneOffset.UTC)); in test_appendZoneRegionId_format_offset()
/libcore/ojluni/src/main/java/java/time/chrono/
DThaiBuddhistDate.java126 public static ThaiBuddhistDate now() { in now() method in ThaiBuddhistDate
127 return now(Clock.systemDefaultZone()); in now()
142 public static ThaiBuddhistDate now(ZoneId zone) { in now() method in ThaiBuddhistDate
143 return now(Clock.system(zone)); in now()
157 public static ThaiBuddhistDate now(Clock clock) { in now() method in ThaiBuddhistDate
158 return new ThaiBuddhistDate(LocalDate.now(clock)); in now()
DMinguoDate.java126 public static MinguoDate now() { in now() method in MinguoDate
127 return now(Clock.systemDefaultZone()); in now()
142 public static MinguoDate now(ZoneId zone) { in now() method in MinguoDate
143 return now(Clock.system(zone)); in now()
157 public static MinguoDate now(Clock clock) { in now() method in MinguoDate
158 return new MinguoDate(LocalDate.now(clock)); in now()
DHijrahDate.java176 public static HijrahDate now() { in now() method in HijrahDate
177 return now(Clock.systemDefaultZone()); in now()
193 public static HijrahDate now(ZoneId zone) { in now() method in HijrahDate
194 return now(Clock.system(zone)); in now()
209 public static HijrahDate now(Clock clock) { in now() method in HijrahDate
210 return HijrahDate.ofEpochDay(HijrahChronology.INSTANCE, LocalDate.now(clock).toEpochDay()); in now()
/libcore/luni/src/test/java/libcore/java/util/
DOldGregorianCalendarTest.java31 Date now = new Date(); in testGetHour() local
34 gc1.setTime(now); in testGetHour()
36 gc2.setTime(now); in testGetHour()
/libcore/luni/src/test/java/libcore/libcore/util/
DZoneInfoTest.java498 assertNotNull(createZoneInfo(getName(), Instant.now(), builder.build())); in testReadTimeZone_valid()
507 createZoneInfo(getName(), Instant.now(), builder.build()); in testReadTimeZone_badMagic()
522 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_TooManyTypes()
538 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_TooManyTransitions()
554 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_NegativeTypes()
570 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_NegativeTransitions()
594 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_TransitionsNotSorted()
618 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_InvalidTypeIndex()
642 createZoneInfo(getName(), Instant.now(), bytes); in testReadTimeZone_InvalidIsDst()
734 return createZoneInfo(getName(), transitions, types, Instant.now()); in createZoneInfo()
/libcore/luni/src/test/java/libcore/java/time/chrono/
DHijrahChronologyTest.java58 HijrahDate date1 = HijrahDate.now(); in test_HijrahDate_withVariant_same()
65 HijrahDate.now().withVariant(null); in test_HijrahDate_withVariant_null()
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKMonthDay.java153 public void now() { in now() method in TCKMonthDay
154 MonthDay expected = MonthDay.now(Clock.systemDefaultZone()); in now()
155 MonthDay test = MonthDay.now(); in now()
160 expected = MonthDay.now(Clock.systemDefaultZone()); in now()
161 test = MonthDay.now(); in now()
171 MonthDay.now((ZoneId) null); in now_ZoneId_nullZoneId()
177 MonthDay expected = MonthDay.now(Clock.system(zone)); in now_ZoneId()
178 MonthDay test = MonthDay.now(zone); in now_ZoneId()
183 expected = MonthDay.now(Clock.system(zone)); in now_ZoneId()
184 test = MonthDay.now(zone); in now_ZoneId()
[all …]

1234