/** * Formats the {@code Time} as a String in JDBC escape format: {@code * hh:mm:ss}. * * @return A String representing the {@code Time} value in JDBC escape * format: {@code HH:mm:ss} */ @Override public String toString() { StringBuilder sb = new StringBuilder(8); format(getHours(), 2, sb); sb.append(':'); format(getMinutes(), 2, sb); sb.append(':'); format(getSeconds(), 2, sb); return sb.toString(); }
int nanosOfSecond = (int)(millis * Conversions.NANOSECONDS_PER_MILLISECOND); return LocalTime.of(time.getHours(), time.getMinutes(), time.getSeconds(), nanosOfSecond);
Assert.assertEquals(newSqlDate.getYear(), s.getSqlDate().getYear()); Assert.assertEquals(sqlTime.getMinutes(), s.getSqlTime().getMinutes()); Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds()); Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
Assert.assertEquals(newSqlDate.getYear(), s.getSqlDate().getYear()); Assert.assertEquals(sqlTime.getMinutes(), s.getSqlTime().getMinutes()); Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds()); Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
Assert.assertEquals(newSqlDate.getYear(), s.getSqlDate().getYear()); Assert.assertEquals(sqlTime.getMinutes(), s.getSqlTime().getMinutes()); Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds()); Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
Assert.assertEquals(newSqlDate.getYear(), s.getSqlDate().getYear()); Assert.assertEquals(sqlTime.getMinutes(), s.getSqlTime().getMinutes()); Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds()); Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
/** * To get the exact time now and to assign the values . */ @SuppressWarnings("deprecation") private void initTime() { Time time = new Time(System.currentTimeMillis()); int hours = time.getHours(); mHourSingleDigits = hours % 10; mHourTenDigits = hours / 10; int minutes = time.getMinutes(); mMinSingleDigits = minutes % 10; mMinTenDigits = minutes / 10; int seconds = time.getSeconds(); mSecSingleDigits = seconds % 10; mSecTenDigits = seconds / 10; }
@SuppressWarnings("deprecation") private Time withTZ(Time time, Calendar cal) { if (time == null) return null; int hour = time.getHours(); int minute = time.getMinutes(); int second = time.getSeconds(); int millis = (int) (time.getTime() % 1000); return new Time(getMillis(cal, 1970, 0, 1, hour, minute, second, millis)); }
/** * Formats the {@code Time} as a String in JDBC escape format: {@code * hh:mm:ss}. * * @return A String representing the {@code Time} value in JDBC escape * format: {@code HH:mm:ss} */ @Override public String toString() { StringBuilder sb = new StringBuilder(8); format(getHours(), 2, sb); sb.append(':'); format(getMinutes(), 2, sb); sb.append(':'); format(getSeconds(), 2, sb); return sb.toString(); }
/** * Formats the {@code Time} as a String in JDBC escape format: {@code * hh:mm:ss}. * * @return A String representing the {@code Time} value in JDBC escape * format: {@code HH:mm:ss} */ @Override public String toString() { StringBuilder sb = new StringBuilder(8); format(getHours(), 2, sb); sb.append(':'); format(getMinutes(), 2, sb); sb.append(':'); format(getSeconds(), 2, sb); return sb.toString(); }
/** * Formats the {@code Time} as a String in JDBC escape format: {@code * hh:mm:ss}. * * @return A String representing the {@code Time} value in JDBC escape * format: {@code HH:mm:ss} */ @Override public String toString() { StringBuilder sb = new StringBuilder(8); format(getHours(), 2, sb); sb.append(':'); format(getMinutes(), 2, sb); sb.append(':'); format(getSeconds(), 2, sb); return sb.toString(); }
/** * Formats the {@code Time} as a String in JDBC escape format: {@code * hh:mm:ss}. * * @return A String representing the {@code Time} value in JDBC escape * format: {@code HH:mm:ss} */ @Override public String toString() { StringBuilder sb = new StringBuilder(8); format(getHours(), 2, sb); sb.append(':'); format(getMinutes(), 2, sb); sb.append(':'); format(getSeconds(), 2, sb); return sb.toString(); }
/** * Converts a {@code java.sql.Time} to a {@code LocalTime}. * * @param sqlTime the SQL time, not null * @return the local time, not null */ @SuppressWarnings("deprecation") public static LocalTime toLocalTime(java.sql.Time sqlTime) { return LocalTime.of(sqlTime.getHours(), sqlTime.getMinutes(), sqlTime.getSeconds()); }
/** * Formats the {@code Time} as a String in JDBC escape format: {@code * hh:mm:ss}. * * @return A String representing the {@code Time} value in JDBC escape * format: {@code HH:mm:ss} */ @Override public String toString() { StringBuilder sb = new StringBuilder(8); format(getHours(), 2, sb); sb.append(':'); format(getMinutes(), 2, sb); sb.append(':'); format(getSeconds(), 2, sb); return sb.toString(); }
/** * Converts a {@code java.sql.Time} to a {@code LocalTime}. * * @param sqlTime the SQL time, not null * @return the local time, not null */ @SuppressWarnings("deprecation") public static LocalTime toLocalTime(java.sql.Time sqlTime) { return LocalTime.of(sqlTime.getHours(), sqlTime.getMinutes(), sqlTime.getSeconds()); }
/** * Converts a {@code java.sql.Time} to a {@code LocalTime}. * * @param sqlTime the SQL time, not null * @return the local time, not null */ @SuppressWarnings("deprecation") public static LocalTime toLocalTime(java.sql.Time sqlTime) { return LocalTime.of(sqlTime.getHours(), sqlTime.getMinutes(), sqlTime.getSeconds()); }
private Date getExecutionTimeValue(GlusterVolumeSnapshotSchedule schedule) { Date dt = new Date(); dt.setHours(schedule.getExecutionTime().getHours()); dt.setMinutes(schedule.getExecutionTime().getMinutes()); return dt; } }),
/** * Get start of application for leave as date with time. * * @return start date with time or {@code null} if start date or start time is missing */ public DateTime getStartDateWithTime() { DateMidnight date = getStartDate(); Time time = getStartTime(); if (date != null && time != null) { return date.toDateTime().withHourOfDay(time.getHours()).withMinuteOfHour(time.getMinutes()); } return null; }
/** * Get end of application for leave as date with time. * * @return end date with time or {@code null} if end date or end time is missing */ public DateTime getEndDateWithTime() { DateMidnight date = getEndDate(); Time time = getEndTime(); if (date != null && time != null) { return date.toDateTime().withHourOfDay(time.getHours()).withMinuteOfHour(time.getMinutes()); } return null; } }
@SuppressWarnings("deprecation") protected void assertDates(Dates dates) { assertNull(dates.nullDate); assertDate(BIRTHDAY, dates.iso8601Date); assertDate(BIRTHDAY, dates.formatedDate); assertDate(BIRTHDAY, dates.sqlDate); assertDate(BIRTHDAY, dates.sqlTimestamp); assertEquals(11, dates.sqlTime.getHours()); assertEquals(22, dates.sqlTime.getMinutes()); assertEquals(33, dates.sqlTime.getSeconds()); assertEquals(11, dates.sqlTimestamp.getHours()); assertEquals(22, dates.sqlTimestamp.getMinutes()); assertEquals(33, dates.sqlTimestamp.getSeconds()); } }