Examples of toLocalDateTime()


Examples of java.time.OffsetDateTime.toLocalDateTime()

    public void all_not_null() throws Exception {
        try (PersistenceSession session = persistenceManager.createSession()) {
            JavatimeConvertEntity inst = new JavatimeConvertEntity();
            inst.setId(99);
            OffsetDateTime dt = OffsetDateTime.ofInstant(new Date().toInstant(), ZoneOffset.of("+0200"));
            LocalDateTime ldt = dt.toLocalDateTime();
            LocalDate ld = ldt.toLocalDate();
            inst.setDateTime(dt);
            inst.setLocalDate(ld);
            inst.setLocalDateTime(ldt);
            session.insert(inst);
View Full Code Here

Examples of javax.time.calendar.LocalTime.Overflow.toLocalDateTime()

        // TODO: correct algorithm
        LocalDate date = this.date.plusYears(period.getYears())
                .plusMonths(period.getMonths()).plusDays(period.getDays());
        Overflow overflow = this.time.plusWithOverflow(
                period.getHours(), period.getMinutes(), period.getSeconds(), period.getNanos());
        LocalDateTime result = overflow.toLocalDateTime(date);
        return (result.equals(this) ? this : result);
    }

    //-----------------------------------------------------------------------
    /**
 
View Full Code Here

Examples of javax.time.calendar.LocalTime.Overflow.toLocalDateTime()

        // TODO: correct algorithm
        LocalDate date = this.date.minusYears(period.getYears())
                .minusMonths(period.getMonths()).minusDays(period.getDays());
        Overflow overflow = this.time.minusWithOverflow(
                period.getHours(), period.getMinutes(), period.getSeconds(), period.getNanos());
        LocalDateTime result = overflow.toLocalDateTime(date);
        return (result.equals(this) ? this : result);
    }

    //-----------------------------------------------------------------------
    /**
 
View Full Code Here

Examples of javax.time.calendar.OffsetDateTime.toLocalDateTime()

     * @return the offset information, never null
     */
    public OffsetInfo getOffsetInfo(Instant instant) {
        ZoneOffset offset = getOffset(instant);
        OffsetDateTime odt = OffsetDateTime.fromInstant(instant, offset);
        return getOffsetInfo(odt.toLocalDateTime());
    }

    /**
     * Gets the offset information for a local date-time in this zone.
     * <p>
 
View Full Code Here

Examples of javax.time.calendar.OffsetDateTime.toLocalDateTime()

     * @return the offset information, never null
     */
    public OffsetInfo getOffsetInfo(Instant instant) {
        ZoneOffset offset = getOffset(instant);
        OffsetDateTime odt = OffsetDateTime.fromInstant(instant, offset);
        return getOffsetInfo(odt.toLocalDateTime());
    }

    /**
     * Gets the offset information for a local date-time in this zone.
     * <p>
 
View Full Code Here

Examples of org.fudgemsg.types.FudgeDateTime.toLocalDateTime()

        if (zone != null) {
          return FlexiDateTime.of(odt.atZoneSameInstant(zone));
        }
        return FlexiDateTime.of(odt);
      } else {
        return FlexiDateTime.of(fudge.toLocalDateTime());
      }
    } else if (obj instanceof FudgeDate) {
      FudgeDate fudge = (FudgeDate) obj;
      return FlexiDateTime.of(fudge.toLocalDate());
    } else if (obj instanceof OffsetDateTime) {
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDateTime()

    }

    public static DateTime convertJodaTimezone(LocalDateTime date, String srcTz, String destTz) {
        DateTime srcDateTime = date.toDateTime(DateTimeZone.forID(srcTz));
        DateTime dstDateTime = srcDateTime.withZone(DateTimeZone.forID(destTz));
        return dstDateTime.toLocalDateTime().toDateTime();
    }

    public static List<String> changeTz(List<String> from, final String fromTimeZone, final String toTimeZone) {
        return Lists.transform(from, new Function<String, String>() {
            @Override
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDateTime()

            DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime());
            if (out == null) {
                return null;
            }
           
            return out.toLocalDateTime();
    } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value));
    }
  }
}
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDateTime()

            case VALUE_STRING:
                DateTime local = parseLocal(jp);
                if (local == null) {
                    return null;
                }
                return local.toLocalDateTime();
            }
            throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Array or Number");
        }
    }
View Full Code Here

Examples of org.joda.time.DateTime.toLocalDateTime()

      DateTime out = new LocaleBasedJodaTimeConverter(localization).convert(value, shortDateTime());
      if (out == null) {
        return null;
      }
   
      return out.toLocalDateTime();
    } catch (Exception e) {
      throw new ConversionError(MessageFormat.format(bundle.getString("is_not_a_valid_datetime"), value));
    }
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.