Examples of toDateMidnight()


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

  Object parse(final String data) {
    try {
      final DateTimeFormatter parseFormat = DateTimeFormat.forPattern(ISO_FORMAT);
      final DateTime date = parseFormat.withZone(DateTimeZone.UTC).parseDateTime(data);
      final DateMidnight dateMidnight = date.toDateMidnight();
      return dateMidnight;
    } catch (final Exception ex) {
      log.error("Can't parse DateMidnight: " + data);
      return new DateMidnight();
    }
View Full Code Here

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

     * @return {@link Date}
     */
    public static Date getNextDayMidnightDate(){
        DateTime midNight = new DateTime();
        midNight = midNight.plusDays(1);
        final DateMidnight midnightDate  = midNight.toDateMidnight();
        return midnightDate.toDate();
    }

    /**
     * Retrieve before day midnight.
View Full Code Here

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

     * @return
     */
    public static Date getBeforeDayMidnightDate(){
        DateTime midNight = new DateTime();
        midNight = midNight.plusDays(-1);
        final DateMidnight midnightDate  = midNight.toDateMidnight();
        return midnightDate.toDate();
    }

    /**
     * Increase a day your date.
View Full Code Here

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

 
  @Test
  public void testUniqueFileMoveUserCount() {   
    //setup date stuff
    DateTime now = DateTime.now();
        Date d2 = now.toDateMidnight().toDate();
        Date d1 = now.minusDays(1).toDateMidnight().toDate()
       
    //create a file move for a user 1
    FileMove mv1 = new FileMove(key1(), "foo", "bar", false);
    mv1.when = d2;
View Full Code Here

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

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

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

      mother.setGestationalAge(gestationalAge);
      mother.setLmp(null);
    } else {
      DateTime lmpEthiopicDate = new DateTime(year, month, day, 12, 0, EthiopicChronology.getInstance());
      DateTime lmpDate = lmpEthiopicDate.withChronology(GregorianChronology.getInstance());
      mother.setLmp(lmpDate.toDateMidnight().toDate());
      mother.setGestationalAge(null);
    }
    mother.setEdd(dateTimeService.parseAmharicDateString(edd));

        if (postId == 0) {
View Full Code Here

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

      mother.setGestationalAge(gestationalAge);
      mother.setLmp(null);
    } else {
      DateTime lmpEthiopicDate = new DateTime(year, month, day, 12, 0, EthiopicChronology.getInstance());
      DateTime lmpDate = lmpEthiopicDate.withChronology(GregorianChronology.getInstance());
      mother.setLmp(lmpDate.toDateMidnight().toDate());
      mother.setGestationalAge(null);
    }
    mother.setEdd(dateTimeService.parseAmharicDateString(edd));
    if (postId == 0) {
      mother.setGott(null);
View Full Code Here

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

   

    public static long toMillis(int year, int monthOfYear, int dayOfMonth) {
        LocalDate d = new LocalDate(year, monthOfYear, dayOfMonth);
        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.LocalDate.toDateMidnight()

  }
 
  @Test
  public void timeZones() {
    LocalDate lt = new LocalDate(2000, 1, 1);
    DateMidnight dm = lt.toDateMidnight(DateTimeZone.UTC);
   
    Assert.assertEquals("2000-01-01T00:00:00.000Z", dm.toString());
  }
}
View Full Code Here

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

  }
 
  @Test
  public void canConvertDate_toGregorianCalendar() {
    LocalDate lt = new LocalDate(2000, 1, 2);
    DateMidnight dm = lt.toDateMidnight(DateTimeZone.UTC);
   
    XMLGregorianCalendar gc = XmlUtils.asXMLGregorianCalendar(dm.toDate());
    Assert.assertEquals("2000-01-02T00:00:00.000Z", gc.toXMLFormat());
  }
 
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.