本文整理了Java中java.sql.Time.getSeconds()
方法的一些代码示例,展示了Time.getSeconds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Time.getSeconds()
方法的具体详情如下:
包路径:java.sql.Time
类名称:Time
方法名:getSeconds
暂无
代码示例来源:origin: robovm/robovm
/**
* 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();
}
代码示例来源:origin: debezium/debezium
return LocalTime.of(time.getHours(),
time.getMinutes(),
time.getSeconds(),
nanosOfSecond);
代码示例来源:origin: Impetus/Kundera
Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds());
Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
代码示例来源:origin: Impetus/Kundera
Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds());
Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
代码示例来源:origin: Impetus/Kundera
Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds());
Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
代码示例来源:origin: Impetus/Kundera
Assert.assertEquals(sqlTime.getSeconds(), s.getSqlTime().getSeconds());
Assert.assertEquals(sqlTime.getHours(), s.getSqlTime().getHours());
代码示例来源:origin: lypeer/GoogleClock
/**
* 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;
}
代码示例来源:origin: org.jooq/jooq
@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));
}
代码示例来源:origin: MobiVM/robovm
/**
* 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();
}
代码示例来源:origin: ibinti/bugvm
/**
* 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();
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* 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();
}
代码示例来源:origin: fenix-framework/fenix-framework
public static LocalTime readLocalTime(ResultSet rs, String columnName) throws SQLException {
// Get the time without specifying a Calendar for the time
// zone, because OJB does not use it when binding the
// preparedStatement also. So, we must get the java.sql.Time
// in the default time zone.
//
// Moreover, if later we decide to change this, we must
// investigate the various options for the MySQL driver,
// because by default I think that it does not behave as
// expected by the JDBC specification. Check the options
// "noTimezoneConversionForTimeType", "useTimezone",
// "useGmtMillisForDatetimes",
// "useJDBCCompliantTimezoneShift", "useLegacyDatetimeCode",
// and "useSSPSCompatibleTimezoneShift" (at least...).
Time time = rs.getTime(columnName);
// Construct the LocalTime with hours, minutes, and seconds,
// for symmetry with the ToSqlConverter code (see the comment
// there, also).
return (rs.wasNull() ? null : new LocalTime(time.getHours(), time.getMinutes(), time.getSeconds()));
}
代码示例来源:origin: FlexoVM/flexovm
/**
* 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();
}
代码示例来源:origin: ThreeTen/threetenbp
/**
* 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());
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* 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();
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* 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();
}
代码示例来源:origin: org.threeten/threetenbp
/**
* 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());
}
代码示例来源:origin: com.github.seratch/java-time-backport
/**
* 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());
}
代码示例来源:origin: io.debezium/debezium-core
return LocalTime.of(time.getHours(),
time.getMinutes(),
time.getSeconds(),
nanosOfSecond);
代码示例来源:origin: hpehl/piriti
@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());
}
}
内容来源于网络,如有侵权,请联系作者删除!