Examples of toDateTime()


Examples of org.joda.time.Instant.toDateTime()

        System.out.println("ISO chronology:       in.getChronology():       " + in.getChronology());
        System.out.println("UTC time zone:        in.getDateTimeZone():     " + in.getZone());
        System.out.println("Change millis:        in.withMillis(0):         " + in.withMillis(0L));
        System.out.println("");
        System.out.println("Convert to Instant:   in.toInstant():           " + in.toInstant());
        System.out.println("Convert to DateTime:  in.toDateTime():          " + in.toDateTime());
        System.out.println("Convert to MutableDT: in.toMutableDateTime():   " + in.toMutableDateTime());
        System.out.println("Convert to Date:      in.toDate():              " + in.toDate());
        System.out.println("");
        System.out.println("                      in2 = new Instant(in.getMillis() + 10)");
        Instant in2 = new Instant(in.getMillis() + 10);
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTime()

    LocalDate end = new LocalDate();
    LocalDate start = end.minusYears(1);

    List<File> result = new ArrayList<File>();
    IPath[] storagePaths = XmlPlugin.getDefault().getStoragePaths();
    MutableDateTime date = start.toDateTime(new LocalTime(0, 0, 0)).toMutableDateTime();
    while (new LocalDate(date.toInstant().getMillis()).compareTo(end) <= 0) {

      for (IPath path : storagePaths) {
        File f = store.getDataFile(new LocalDate(date.getMillis()), path);
        if (f.exists()) {
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTime()

           
            // Guarantee new date is aligned to a business date.
            calculator.setStartDate(dt.toLocalDate());
            LocalDate ldt = calculator.getCurrentBusinessDate();
            if(!ldt.isEqual(dt.toLocalDate())) {
                tradingSession = getTradingSessionOnOrAfter(ldt.toDateTime(dt.toLocalTime()));
                if(tradingSession.day() < dt.getDayOfWeek()) {
                    dt = dt.plusDays((DateTimeConstants.SUNDAY - dt.getDayOfWeek()) + 1);
                }
                dt = dt.withDayOfWeek(tradingSession.day());
                LocalTime lt = tradingSession.start();
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTime()

        earliestDate = newEarliestDate;

        // Input field validation - date should be _after_ minimumDate (not the same)
        LocalDate minimumDate = newEarliestDate.minusDays( 1 );
        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
        add( DateValidator.minimum( convertedMinimumDate ) );

        return this;
    }
View Full Code Here

Examples of org.joda.time.LocalDate.toDateTime()

        earliestDate = newEarliestDate;

        // Input field validation - date should be _after_ minimumDate (not the same)
        LocalDate minimumDate = newEarliestDate.minusDays( 1 );
        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
        add( DateValidator.minimum( convertedMinimumDate ) );

        return this;
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime.toDateTime()

        assertThat(scalarRepr.isString(), is(true));

        final LocalDateTime expected = new LocalDateTime(2009, 4, 29, 13, 45, 22);

        assertThat(scalarRepr.asDateTime(), is(expected.toDate()));
        assertThat(scalarRepr.asString(), is(ISODateTimeFormat.dateTimeNoMillis().withZoneUTC().print(expected.toDateTime())));

        // and then member types have links to details (selected ones inspected only)
        property = domainObjectRepr.getProperty("localDateProperty");
        assertThat(property.getLinkWithRel(Rel.DETAILS),
                isLink()
View Full Code Here

Examples of org.joda.time.LocalDateTime.toDateTime()

        return d.toDateMidnight().getMillis();
    }

    public static long toMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute) {
        LocalDateTime d = new LocalDateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute);
        return d.toDateTime().getMillis();
    }

}
View Full Code Here

Examples of org.joda.time.LocalDateTime.toDateTime()

        if (data instanceof DateTime) {
            DateTime dateTime = (DateTime) data;
            milliSeconds = dateTime.getMillis();
        } else if (data instanceof LocalDateTime) {
            LocalDateTime date = (LocalDateTime) data;
            milliSeconds = date.toDateTime().toDate().getTime();
        } else {
            throw new ConversionException(data.getClass());
        }
        return new NonNestedOutboundVariable("new Date(" + milliSeconds + ")");
    }
View Full Code Here

Examples of org.joda.time.LocalDateTime.toDateTime()

          value = new ShortBlob(bValue);
        }
      } else if (type.equals(EdmSimpleType.DATETIME)) {
        LocalDateTime dValue = (LocalDateTime) value;
        if (dValue != null) {
          value = dValue.toDateTime().toDate(); // TODO review
        }
      }
      e.setProperty(prop.getName(), value);
    }
  }
View Full Code Here

Examples of org.joda.time.LocalDateTime.toDateTime()

  @Test
  public void testTurnOffTrueDayOfWeek() {
    LocalDateTime time = new LocalDateTime().withDayOfWeek(
        DateTimeConstants.SATURDAY).withHourOfDay(12);

    DateTimeUtils.setCurrentMillisFixed(time.toDateTime().toInstant()
        .getMillis());

    Assert.assertTrue("Should have been true for Saturday, 12:00 PM: ",
        this.criteria.shouldTurnOff());
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.