Examples of toLocalDate()


Examples of java.time.LocalDateTime.toLocalDate()

        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 java.time.LocalDateTime.toLocalDate()

                        moveMessages(msgs, source, getFolder(rule.getDestFolder(), Folder.READ_WRITE));
                    }
                } else if (rule.getOlderThan() > 0) {
                    LocalDateTime day = LocalDateTime.now().minusDays(rule.getOlderThan());
                    SentDateTerm term = new SentDateTerm(ComparisonTerm.LE,
                            Date.from(day.toLocalDate().atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()));
                    Message[] msgs = source.search(term);
                    if (msgs != null && msgs.length > 0) {
                        deleteMessages(msgs, source);
                    }
                }
View Full Code Here

Examples of lombok.val.toLocalDate()

    if (value != null)
    {
      // use the existing validation method
      val result = validate(value.toLocalDateTime(LocalTime.MIDNIGHT));
      if (result != null)
        return result.toLocalDate();
    } else
      // check if null allowed, using the other validate()
      validate((LocalDateTime) null);

    return null;
View Full Code Here

Examples of org.fudgemsg.types.FudgeDate.toLocalDate()

      } 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) {
      OffsetDateTime odt = (OffsetDateTime) obj;
      if (zone != null) {
        return FlexiDateTime.of(odt.atZoneSameInstant(zone));
      }
View Full Code Here

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

      } 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) {
      OffsetDateTime odt = (OffsetDateTime) obj;
      if (zone != null) {
        return FlexiDateTime.of(odt.atZoneSameInstant(zone));
      }
View Full Code Here

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

        buf = new StringBuilder();
        f.printTo(buf, dt.getMillis());
        assertEquals("Wed 2004-06-09T11:20:30+01:00", buf.toString());
       
        buf = new StringBuilder();
        ISODateTimeFormat.yearMonthDay().printTo(buf, dt.toLocalDate());
        assertEquals("2004-06-09", buf.toString());
       
        buf = new StringBuilder();
        try {
            ISODateTimeFormat.yearMonthDay().printTo(buf, (ReadablePartial) null);
View Full Code Here

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

  }

  @Test
  public void testIsSameMonthInYear_DateTimeAndLocalDate() {
    DateTime dateTime = new DateTime();
    assertTrue(isSameMonthInYear(dateTime, dateTime.toLocalDate()));
    assertFalse(isSameMonthInYear(dateTime, dateTime.toLocalDate()
        .plusMonths(1)));
    assertFalse(isSameMonthInYear(dateTime, dateTime.toLocalDate().plusYears(1)));
  }
View Full Code Here

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

  @Test
  public void testIsSameMonthInYear_DateTimeAndLocalDate() {
    DateTime dateTime = new DateTime();
    assertTrue(isSameMonthInYear(dateTime, dateTime.toLocalDate()));
    assertFalse(isSameMonthInYear(dateTime, dateTime.toLocalDate()
        .plusMonths(1)));
    assertFalse(isSameMonthInYear(dateTime, dateTime.toLocalDate().plusYears(1)));
  }

  @Test
View Full Code Here

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

  public void testIsSameMonthInYear_DateTimeAndLocalDate() {
    DateTime dateTime = new DateTime();
    assertTrue(isSameMonthInYear(dateTime, dateTime.toLocalDate()));
    assertFalse(isSameMonthInYear(dateTime, dateTime.toLocalDate()
        .plusMonths(1)));
    assertFalse(isSameMonthInYear(dateTime, dateTime.toLocalDate().plusYears(1)));
  }

  @Test
  public void testToLocalDate() {
    XMLGregorianCalendar cal = toXmlDate(new DateTime());
View Full Code Here

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

  public void insert(E event) {

    DateTime time = event.getTime();
    if (!isSameMonthInYear(event.getTime(), currentMonth)) {
      commit();
      currentMonth = time.toLocalDate();
    }

    IMerger<T> merger = getMerger();
    T element = getConverter().convert(event);
    for (S category : data) {
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.