Searched refs:hours (Results 1 - 21 of 21) sorted by relevance

/libcore/ojluni/src/main/java/java/time/
H A DZoneOffset.java94 * This is usually a fixed number of hours and minutes.
100 * For example, Paris is one hour ahead of Greenwich/UTC in winter and two hours
110 * The fields of hours, minutes and seconds make assumptions that are valid for the
205 final int hours, minutes, seconds;
210 hours = parseNumber(offsetId, 1, false);
215 hours = parseNumber(offsetId, 1, false);
220 hours = parseNumber(offsetId, 1, false);
225 hours = parseNumber(offsetId, 1, false);
230 hours = parseNumber(offsetId, 1, false);
242 return ofHoursMinutesSeconds(-hours,
276 ofHours(int hours) argument
293 ofHoursMinutes(int hours, int minutes) argument
310 ofHoursMinutesSeconds(int hours, int minutes, int seconds) argument
356 validate(int hours, int minutes, int seconds) argument
393 totalSeconds(int hours, int minutes, int seconds) argument
[all...]
H A DLocalTime.java353 int hours = (int) (secondOfDay / SECONDS_PER_HOUR);
354 secondOfDay -= hours * SECONDS_PER_HOUR;
357 return create(hours, minutes, (int) secondOfDay, 0);
371 int hours = (int) (nanoOfDay / NANOS_PER_HOUR);
372 nanoOfDay -= hours * NANOS_PER_HOUR;
377 return create(hours, minutes, seconds, (int) nanoOfDay);
1013 * Returns a {@code LocalTime} with the specified number of hours added.
1056 * Returns a copy of this {@code LocalTime} with the specified number of hours added.
1058 * This adds the specified number of hours to this time, returning a new time.
1063 * @param hoursToAdd the hours t
[all...]
H A DOffsetTime.java881 * Returns a copy of this {@code OffsetTime} with the specified number of hours added.
883 * This adds the specified number of hours to this time, returning a new time.
888 * @param hours the hours to add, may be negative
889 * @return an {@code OffsetTime} based on this time with the hours added, not null
891 public OffsetTime plusHours(long hours) { argument
892 return with(time.plusHours(hours), offset);
992 * Returns a copy of this {@code OffsetTime} with the specified number of hours subtracted.
994 * This subtracts the specified number of hours from this time, returning a new time.
999 * @param hours th
1002 minusHours(long hours) argument
[all...]
H A DLocalDateTime.java1286 * Returns a copy of this {@code LocalDateTime} with the specified number of hours added.
1290 * @param hours the hours to add, may be negative
1291 * @return a {@code LocalDateTime} based on this date-time with the hours added, not null
1294 public LocalDateTime plusHours(long hours) { argument
1295 return plusWithOverflow(date, hours, 0, 0, 0, 1);
1481 * Returns a copy of this {@code LocalDateTime} with the specified number of hours subtracted.
1485 * @param hours the hours to subtract, may be negative
1486 * @return a {@code LocalDateTime} based on this date-time with the hours subtracte
1489 minusHours(long hours) argument
1546 plusWithOverflow(LocalDate newDate, long hours, long minutes, long seconds, long nanos, int sign) argument
[all...]
H A DDuration.java101 * It can be accessed using other duration-based units, such as minutes and hours.
103 * exactly equal to 24 hours, thus ignoring daylight savings effects.
177 * Obtains a {@code Duration} representing a number of standard hours.
183 * @param hours the number of hours, positive or negative
185 * @throws ArithmeticException if the input hours exceeds the capacity of {@code Duration}
187 public static Duration ofHours(long hours) { argument
188 return create(Math.multiplyExact(hours, SECONDS_PER_HOUR), 0);
293 * be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.
318 * or be {@link ChronoUnit#DAYS} which is treated as 24 hours
[all...]
H A DOffsetDateTime.java1277 * Returns a copy of this {@code OffsetDateTime} with the specified number of hours added.
1281 * @param hours the hours to add, may be negative
1282 * @return an {@code OffsetDateTime} based on this date-time with the hours added, not null
1285 public OffsetDateTime plusHours(long hours) { argument
1286 return with(dateTime.plusHours(hours), offset);
1466 * Returns a copy of this {@code OffsetDateTime} with the specified number of hours subtracted.
1470 * @param hours the hours to subtract, may be negative
1471 * @return an {@code OffsetDateTime} based on this date-time with the hours subtracte
1474 minusHours(long hours) argument
[all...]
H A DZonedDateTime.java1695 * Returns a copy of this {@code ZonedDateTime} with the specified number of hours added.
1701 * thus adding one day is not the same as adding 24 hours.
1709 * <li>Adding three hours to 00:30+02:00 will result in 02:30+01:00
1714 * @param hours the hours to add, may be negative
1715 * @return a {@code ZonedDateTime} based on this date-time with the hours added, not null
1718 public ZonedDateTime plusHours(long hours) { argument
1719 return resolveInstant(dateTime.plusHours(hours));
1936 * Returns a copy of this {@code ZonedDateTime} with the specified number of hours subtracted.
1942 * thus subtracting one day is not the same as adding 24 hours
1959 minusHours(long hours) argument
[all...]
/libcore/ojluni/src/main/java/sun/util/calendar/
H A DCalendarDate.java74 private int hours; field in class:CalendarDate
219 return hours;
222 public CalendarDate setHours(int hours) { argument
223 if (this.hours != hours) {
224 this.hours = hours;
232 hours += n;
319 public CalendarDate setTimeOfDay(int hours, int minutes, int seconds, int millis) { argument
320 setHours(hours);
327 addTimeOfDay(int hours, int minutes, int seconds, int millis) argument
[all...]
H A DImmutableGregorianDate.java101 public CalendarDate setHours(int hours) { argument
157 public CalendarDate setTimeOfDay(int hours, int minutes, int seconds, int millis) { argument
161 public CalendarDate addTimeOfDay(int hours, int minutes, int seconds, int millis) { argument
H A DAbstractCalendar.java247 int hours = time / HOUR_IN_MILLIS;
253 cdate.setHours(hours);
258 if (hours < 24 && normalizedState) {
/libcore/luni/src/main/java/javax/xml/datatype/
H A DDatatypeFactory.java208 * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
222 * @param hours of this <code>Duration</code>
236 final BigInteger hours,
242 * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p>
251 * @param hours of this <code>Duration</code>
264 * BigInteger hours,
273 final int hours,
286 // hours may not be set
287 BigInteger realHours = (hours != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) hours)
231 newDuration( final boolean isPositive, final BigInteger years, final BigInteger months, final BigInteger days, final BigInteger hours, final BigInteger minutes, final BigDecimal seconds) argument
268 newDuration( final boolean isPositive, final int years, final int months, final int days, final int hours, final int minutes, final int seconds) argument
922 newXMLGregorianCalendarTime( final int hours, final int minutes, final int seconds, final int timezone) argument
960 newXMLGregorianCalendarTime( final int hours, final int minutes, final int seconds, final BigDecimal fractionalSecond, final int timezone) argument
998 newXMLGregorianCalendarTime( final int hours, final int minutes, final int seconds, final int milliseconds, final int timezone) argument
[all...]
H A DDuration.java34 * which consists of six fields (years, months, days, hours,
444 * "-(1 hour,50 minutes)" + "-20 minutes" = "-(1 hours,70 minutes)"
445 * "15 hours" + "-3 days" = "-(2 days,9 hours)"
571 * "-(1 hour,50 minutes)" - "-20 minutes" = "-(1hours,30 minutes)"
572 * "15 hours" - "-3 days" = "3 days and 15 hours"
661 * which will be carried down to "PT12H" (12 hours).
714 * <li>the computed days, along with the hours, minutes and seconds
772 * <p>For example, "P1D" (one day) > "PT12H" (12 hours) an
[all...]
/libcore/ojluni/src/main/java/java/time/chrono/
H A DChronoLocalDateTimeImpl.java325 private ChronoLocalDateTimeImpl<D> plusHours(long hours) { argument
326 return plusWithOverflow(date, hours, 0, 0, 0);
342 private ChronoLocalDateTimeImpl<D> plusWithOverflow(D newDate, long hours, long minutes, long seconds, long nanos) { argument
344 if ((hours | minutes | seconds | nanos) == 0) {
350 hours / HOURS_PER_DAY; // max/24
354 (hours % HOURS_PER_DAY) * NANOS_PER_HOUR; // max 86400000000000
/libcore/ojluni/src/test/java/time/tck/java/time/
H A DTCKZoneOffset.java640 private void doTestOffset(ZoneOffset offset, int hours, int minutes, int seconds) { argument
641 assertEquals(offset.getTotalSeconds(), hours * 60 * 60 + minutes * 60 + seconds);
643 if (hours == 0 && minutes == 0 && seconds == 0) {
646 String str = (hours < 0 || minutes < 0 || seconds < 0) ? "-" : "+";
647 str += Integer.toString(Math.abs(hours) + 100).substring(1);
657 assertEquals(offset, ZoneOffset.ofHoursMinutesSeconds(hours, minutes, seconds));
659 assertEquals(offset, ZoneOffset.ofHoursMinutes(hours, minutes));
661 assertEquals(offset, ZoneOffset.ofHours(hours));
H A DTCKDuration.java1212 public void plusHours_long(long hours, long amount, long expectedHours) { argument
1213 Duration t = Duration.ofHours(hours);
1831 public void minusHours_long(long hours, long amount, long expectedHours) { argument
1832 Duration t = Duration.ofHours(hours);
H A DTCKLocalTime.java1520 int hours = (int) (Long.MAX_VALUE % 24L);
1521 assertEquals(t, LocalTime.of(2, 30).plusHours(hours));
1946 int hours = (int) (Long.MAX_VALUE % 24L);
1947 assertEquals(t, LocalTime.of(2, 30).minusHours(hours));
/libcore/luni/src/test/java/libcore/java/util/
H A DGregorianCalendarTest.java41 Calendar.MARCH, 9, 0, hours(2),
42 Calendar.NOVEMBER, 2, 0, hours(2),
43 hours(1));
117 // "1st Jan 2000 00:00:01 GMT" is 8 hours before the Julian/Gregorian switch in LA. The day
493 private static int hours(int count) { method in class:GregorianCalendarTest
/libcore/ojluni/src/main/java/java/text/
H A DSimpleDateFormat.java1977 int hours;
1981 hours = c - '0';
1984 hours = hours * 10 + (c - '0');
1988 if (hours > 23) {
2023 minutes += hours * 60;
/libcore/ojluni/src/main/java/java/util/
H A DDate.java97 * year, month, date, hours, minutes, and seconds values, the
210 * @param hrs the hours between 0-23.
233 * @param hrs the hours between 0-23.
304 * @param hrs the hours between 0-23.
352 * 13:30:00 GMT+0430" (4 hours, 30 minutes west of the Greenwich
371 * in hours. Otherwise, it is regarded as an offset in minutes,
375 * <tt>-5</tt> occurring in the string would mean "five hours west
376 * of Greenwich" and <tt>+0430</tt> would mean "four hours and
434 * North America that is five, six, seven, or eight hours west of
507 // parse the number following it as loosely as the original hours
829 setHours(int hours) argument
[all...]
H A DGregorianCalendar.java321 * + (calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000))); // in hours
323 * + (calendar.get(Calendar.DST_OFFSET)/(60*60*1000))); // in hours
1017 delta *= 60 * 60 * 1000; // hours to minutes
1047 // and +12 or -12 hours (timeOfDay).
1201 int unit = max + 1; // 12 or 24 hours
2455 int hours = timeOfDay / ONE_HOUR;
2456 internalSet(HOUR_OF_DAY, hours);
2457 internalSet(AM_PM, hours / 12); // Assume AM == 0
2458 internalSet(HOUR, hours % 12);
2867 * "14:00 UTC" to "14:00 UTC-08:00" we must subtract -08:00 (i.e. add 8 hours)
[all...]
H A DJapaneseImperialCalendar.java429 delta *= 60 * 60 * 1000; // hours to milliseconds
459 // and +12 or -12 hours (timeOfDay).
567 int unit = max + 1; // 12 or 24 hours
1642 int hours = timeOfDay / ONE_HOUR;
1643 internalSet(HOUR_OF_DAY, hours);
1644 internalSet(AM_PM, hours / 12); // Assume AM == 0
1645 internalSet(HOUR, hours % 12);

Completed in 1330 milliseconds