Package org.joda.time

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


    private DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalDateTime dt = (LocalDateTime) value;
      long milliseconds = dt.toDate().getTime();
      return StandardConverters.convertToBytes(milliseconds);
    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
View Full Code Here


            setCellValueForDate(cell, date, dateCellStyle);
            return true;
        }
        if(valueAsObj instanceof LocalDateTime) {
            LocalDateTime value = (LocalDateTime) valueAsObj;
            Date date = value.toDate();
            setCellValueForDate(cell, date, dateCellStyle);
            return true;
        }
        if(valueAsObj instanceof DateTime) {
            DateTime value = (DateTime) valueAsObj;
View Full Code Here

            setCellValueForDate(cell, date, dateCellStyle);
            return true;
        }
        if(valueAsObj instanceof DateTime) {
            DateTime value = (DateTime) valueAsObj;
            Date date = value.toDate();
            setCellValueForDate(cell, date, dateCellStyle);
            return true;
        }
       
        // number
View Full Code Here

        assertThat(result.getStatus(), is(HttpStatusCode.OK));
       
        final DomainObjectRepresentation afterResp = result.getEntity().as(DomainObjectRepresentation.class);
       
        assertThat(afterResp.getProperty("localDateProperty").getString("value"), is("2013-05-01")); // being a bit hacky here...
        assertThat(afterResp.getProperty("localDateTimeProperty").getDateTime("value"), is(ldt.toDate()));
        assertThat(afterResp.getProperty("dateTimeProperty").getDateTime("value"), is(dt.toDate()));
        assertThat(afterResp.getProperty("stringProperty").getString("value"), is(s));
    }
   
    private static String asIso(final java.util.Date d) {
View Full Code Here

        assertThat(followedRepr(modifyLink,argRepr).getString("value"), is("2013-05-01")); // hacky

        // LocalDateTime
        final LocalDateTime ldt = new LocalDateTime(2013,2,1,14,15,0);
        modifyLink = getObjectPropertyReprModifyLink("JODA", "73", "localDateTimeProperty");
        argRepr = modifyLink.getArguments().mapPut("value", asIso(ldt.toDate()));
        assertThat(followedRepr(modifyLink,argRepr).getDateTime("value"), is(ldt.toDate()));
       
        // DateTime
        final DateTime dt = new DateTime(2013,2,1,14,15,0);
        modifyLink = getObjectPropertyReprModifyLink("JODA", "73", "dateTimeProperty");
View Full Code Here

        // LocalDateTime
        final LocalDateTime ldt = new LocalDateTime(2013,2,1,14,15,0);
        modifyLink = getObjectPropertyReprModifyLink("JODA", "73", "localDateTimeProperty");
        argRepr = modifyLink.getArguments().mapPut("value", asIso(ldt.toDate()));
        assertThat(followedRepr(modifyLink,argRepr).getDateTime("value"), is(ldt.toDate()));
       
        // DateTime
        final DateTime dt = new DateTime(2013,2,1,14,15,0);
        modifyLink = getObjectPropertyReprModifyLink("JODA", "73", "dateTimeProperty");
        argRepr = modifyLink.getArguments().mapPut("value", asIso(dt.toDate()));
View Full Code Here

    private DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalDateTime dt = (LocalDateTime) value;
      long milliseconds = dt.toDate().getTime();
      return StandardConverters.convertToBytes(milliseconds);
    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
View Full Code Here

    private DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalDateTime dt = (LocalDateTime) value;
      long milliseconds = dt.toDate().getTime();
      return StandardConverters.convertToBytes(milliseconds);
    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
View Full Code Here

    private DateTimeFormatter fmt = ISODateTimeFormat.dateTime();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalDateTime dt = (LocalDateTime) value;
      long milliseconds = dt.toDate().getTime();
      return StandardConverters.convertToBytes(milliseconds);
    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
View Full Code Here

    mongoTemplate.dropCollection(User.class);

    LocalDateTime now = new LocalDateTime();

    User user1 = new User("u1", new PushMessage("1", "aaa", now.toDate()));
    User user2 = new User("u2", new PushMessage("2", "bbb", now.minusDays(2).toDate()));
    User user3 = new User("u3", new PushMessage("3", "ccc", now.minusDays(1).toDate()));

    mongoTemplate.save(user1);
    mongoTemplate.save(user2);
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.