org.joda.time.LocalTime.toDateTimeToday()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中org.joda.time.LocalTime.toDateTimeToday()方法的一些代码示例,展示了LocalTime.toDateTimeToday()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalTime.toDateTimeToday()方法的具体详情如下:
包路径:org.joda.time.LocalTime
类名称:LocalTime
方法名:toDateTimeToday

LocalTime.toDateTimeToday介绍

[英]Converts this LocalTime to a full datetime using the default time zone setting the time fields from this instance and the date fields from the current date.
[中]使用默认时区设置此实例的时间字段和当前日期的日期字段,将此LocalTime转换为完整日期时间。

代码示例

代码示例来源:origin: joda-time/joda-time

/**
 * Converts this LocalTime to a full datetime using the default time zone
 * setting the time fields from this instance and the date fields from
 * the current date.
 *
 * @return this time as a datetime using today's date
 */
public DateTime toDateTimeToday() {
  return toDateTimeToday(null);
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Converts this LocalTime to a full datetime using the default time zone
 * setting the time fields from this instance and the date fields from
 * the current date.
 *
 * @return this time as a datetime using today's date
 */
public DateTime toDateTimeToday() {
  return toDateTimeToday(null);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Converts this LocalTime to a full datetime using the default time zone
 * setting the time fields from this instance and the date fields from
 * the current date.
 *
 * @return this time as a datetime using todays date
 */
public DateTime toDateTimeToday() {
  return toDateTimeToday(null);
}

代码示例来源:origin: benas/random-beans

/**
 * Create a new {@link JodaTimeLocalTimeRangeRandomizer}.
 * @param min date
 * @param max date
 * @param seed initial seed
 */
public JodaTimeLocalTimeRangeRandomizer(final LocalTime min, final LocalTime max, final long seed) {
  super(min.toDateTimeToday().toDate(), max.toDateTimeToday().toDate(), seed);
}

代码示例来源:origin: aaberg/sql2o

public Object toDatabaseParam(LocalTime val) {
    return new Timestamp(val.toDateTimeToday().getMillis());
  }
}

代码示例来源:origin: ebean-orm/ebean

@Override
public Object toJdbcType(Object value) {
 if (value instanceof LocalTime) {
  LocalTime lt = (LocalTime) value;
  return new Time(lt.toDateTimeToday().getMillis());
 }
 return BasicTypeConverter.toTime(value);
}

代码示例来源:origin: ebean-orm/ebean

@Override
public void bind(DataBind b, LocalTime value) throws SQLException {
 if (value == null) {
  b.setNull(Types.TIME);
 } else {
  b.setTime(new Time(value.toDateTimeToday().getMillis()));
 }
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

/**
 * Converts this LocalTime to a full datetime using the default time zone
 * setting the time fields from this instance and the date fields from
 * the current date.
 *
 * @return this time as a datetime using todays date
 */
public DateTime toDateTimeToday() {
  return toDateTimeToday(null);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Converts this LocalTime to a full datetime using the default time zone
 * setting the time fields from this instance and the date fields from
 * the current date.
 *
 * @return this time as a datetime using todays date
 */
public DateTime toDateTimeToday() {
  return toDateTimeToday(null);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Converts this LocalTime to a full datetime using the default time zone
 * setting the time fields from this instance and the date fields from
 * the current date.
 *
 * @return this time as a datetime using today's date
 */
public DateTime toDateTimeToday() {
  return toDateTimeToday(null);
}

代码示例来源:origin: arnaudroger/SimpleFlatMapper

@Override
  public Date convert(LocalTime in, Context context) throws Exception {
    if (in == null) return null;
    return in.toDateTimeToday(dateTimeZone).toDate();
  }
}

代码示例来源:origin: cmlbeliever/SpringBatch

/**
 * {@link LocalTime}は{@link java.sql.Time}を変換する
 * 
 * @param time
 *            a time
 * @return {@link java.sql.Time}
 */
public static java.sql.Time convert(LocalTime time) {
  return new java.sql.Time(time.toDateTimeToday().getMillis());
}

代码示例来源:origin: me.soliveirajr/menta-bean

@Override
public void bindToStmt(PreparedStatement stmt, int index, LocalTime value) throws SQLException {
  
  if (value == null)
    stmt.setNull(index, Types.TIME);
  else
    stmt.setTime(index, new Time(value.toDateTimeToday().getMillis()));
}

代码示例来源:origin: stackoverflow.com

LocalTime lt = LocalTime.parse("6:00 am", 
        new DateTimeFormatterBuilder().
                appendHourOfDay(1).
                appendLiteral(":").
                appendMinuteOfHour(1).
                appendLiteral(" ").
                appendHalfdayOfDayText().toFormatter());
LocalTime midnight = LocalTime.MIDNIGHT;
Duration duration = new Duration(midnight.toDateTimeToday(), lt.toDateTimeToday());
System.out.println(duration.toStandardSeconds().getSeconds());

代码示例来源:origin: io.ebean/ebean

@Override
public Object toJdbcType(Object value) {
 if (value instanceof LocalTime) {
  LocalTime lt = (LocalTime) value;
  return new Time(lt.toDateTimeToday().getMillis());
 }
 return BasicTypeConverter.toTime(value);
}

代码示例来源:origin: org.avaje.ebean/ebean

@Override
public Object toJdbcType(Object value) {
 if (value instanceof LocalTime) {
  LocalTime lt = (LocalTime) value;
  return new Time(lt.toDateTimeToday().getMillis());
 }
 return BasicTypeConverter.toTime(value);
}

代码示例来源:origin: com.github.almex/raildelays-batch

private Long computeDelay() {
  Long result = 0L;
  if (expectedArrivalTime != null && effectiveArrivalTime != null) {
    LocalTime expected = new LocalTime(expectedArrivalTime);
    LocalTime effective = new LocalTime(effectiveArrivalTime);
    Duration duration = new Duration(expected.toDateTimeToday(), effective.toDateTimeToday());
    result = duration.getStandardMinutes();
  }
  return result;
}

代码示例来源:origin: org.jasig.portlet.utils/portlet-ws-util

public static String printTime(LocalTime localTime) {
  final DateTime dateTime = localTime.toDateTimeToday(DateTimeZone.UTC);
  final GregorianCalendar cal = dateTime.toGregorianCalendar();
  return DatatypeConverter.printTime(cal);
}

代码示例来源:origin: org.apache.drill.exec/drill-java-exec

@Override
public Time getTime(int index) {
 org.joda.time.LocalTime time = new org.joda.time.LocalTime(ac.get(index), org.joda.time.DateTimeZone.UTC);
 // use "toDateTimeToday()"  and "getMillis()" to get the local milliseconds from the Java epoch of 1970-01-01T00:00:00
 return new TimePrintMillis(time.toDateTimeToday().getMillis());
}

代码示例来源:origin: arnaudroger/SimpleFlatMapper

@Test
public void testJodaLocalTime() throws Exception {
  org.joda.time.LocalTime value = new org.joda.time.LocalTime();
  DateTimeZone dateTimeZone = DateTimeZone.forTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
  newFieldMapperAndMapToPS(new ConstantGetter<Object, org.joda.time.LocalTime>(value), org.joda.time.LocalTime.class, dateTimeZone);
  newFieldMapperAndMapToPS(NullGetter.<Object,  org.joda.time.LocalTime>getter(), org.joda.time.LocalTime.class);
  verify(ps).setTime(1, new Time(value.toDateTimeToday(dateTimeZone).getMillis()));
  verify(ps).setNull(2, Types.TIME);
}

相关文章