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

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

本文整理了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

  1. /**
  2. * Converts this LocalTime to a full datetime using the default time zone
  3. * setting the time fields from this instance and the date fields from
  4. * the current date.
  5. *
  6. * @return this time as a datetime using today's date
  7. */
  8. public DateTime toDateTimeToday() {
  9. return toDateTimeToday(null);
  10. }

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

  1. /**
  2. * Converts this LocalTime to a full datetime using the default time zone
  3. * setting the time fields from this instance and the date fields from
  4. * the current date.
  5. *
  6. * @return this time as a datetime using today's date
  7. */
  8. public DateTime toDateTimeToday() {
  9. return toDateTimeToday(null);
  10. }

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

  1. /**
  2. * Converts this LocalTime to a full datetime using the default time zone
  3. * setting the time fields from this instance and the date fields from
  4. * the current date.
  5. *
  6. * @return this time as a datetime using todays date
  7. */
  8. public DateTime toDateTimeToday() {
  9. return toDateTimeToday(null);
  10. }

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

  1. /**
  2. * Create a new {@link JodaTimeLocalTimeRangeRandomizer}.
  3. * @param min date
  4. * @param max date
  5. * @param seed initial seed
  6. */
  7. public JodaTimeLocalTimeRangeRandomizer(final LocalTime min, final LocalTime max, final long seed) {
  8. super(min.toDateTimeToday().toDate(), max.toDateTimeToday().toDate(), seed);
  9. }

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

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

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

  1. @Override
  2. public Object toJdbcType(Object value) {
  3. if (value instanceof LocalTime) {
  4. LocalTime lt = (LocalTime) value;
  5. return new Time(lt.toDateTimeToday().getMillis());
  6. }
  7. return BasicTypeConverter.toTime(value);
  8. }

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

  1. @Override
  2. public void bind(DataBind b, LocalTime value) throws SQLException {
  3. if (value == null) {
  4. b.setNull(Types.TIME);
  5. } else {
  6. b.setTime(new Time(value.toDateTimeToday().getMillis()));
  7. }
  8. }

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

  1. /**
  2. * Converts this LocalTime to a full datetime using the default time zone
  3. * setting the time fields from this instance and the date fields from
  4. * the current date.
  5. *
  6. * @return this time as a datetime using todays date
  7. */
  8. public DateTime toDateTimeToday() {
  9. return toDateTimeToday(null);
  10. }

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

  1. /**
  2. * Converts this LocalTime to a full datetime using the default time zone
  3. * setting the time fields from this instance and the date fields from
  4. * the current date.
  5. *
  6. * @return this time as a datetime using todays date
  7. */
  8. public DateTime toDateTimeToday() {
  9. return toDateTimeToday(null);
  10. }

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

  1. /**
  2. * Converts this LocalTime to a full datetime using the default time zone
  3. * setting the time fields from this instance and the date fields from
  4. * the current date.
  5. *
  6. * @return this time as a datetime using today's date
  7. */
  8. public DateTime toDateTimeToday() {
  9. return toDateTimeToday(null);
  10. }

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

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

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

  1. /**
  2. * {@link LocalTime}は{@link java.sql.Time}を変換する
  3. *
  4. * @param time
  5. * a time
  6. * @return {@link java.sql.Time}
  7. */
  8. public static java.sql.Time convert(LocalTime time) {
  9. return new java.sql.Time(time.toDateTimeToday().getMillis());
  10. }

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

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

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

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

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

  1. @Override
  2. public Object toJdbcType(Object value) {
  3. if (value instanceof LocalTime) {
  4. LocalTime lt = (LocalTime) value;
  5. return new Time(lt.toDateTimeToday().getMillis());
  6. }
  7. return BasicTypeConverter.toTime(value);
  8. }

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

  1. @Override
  2. public Object toJdbcType(Object value) {
  3. if (value instanceof LocalTime) {
  4. LocalTime lt = (LocalTime) value;
  5. return new Time(lt.toDateTimeToday().getMillis());
  6. }
  7. return BasicTypeConverter.toTime(value);
  8. }

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

  1. private Long computeDelay() {
  2. Long result = 0L;
  3. if (expectedArrivalTime != null && effectiveArrivalTime != null) {
  4. LocalTime expected = new LocalTime(expectedArrivalTime);
  5. LocalTime effective = new LocalTime(effectiveArrivalTime);
  6. Duration duration = new Duration(expected.toDateTimeToday(), effective.toDateTimeToday());
  7. result = duration.getStandardMinutes();
  8. }
  9. return result;
  10. }

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

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

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

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

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

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

相关文章