Examples of parseDateTime()


Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

    DateTimeFormatter fmt = ISODateTimeFormat.dateTimeParser().withZone(DateTimeZone.UTC);
    DateMidnight start = fmt.parseDateTime(r.getRequestParameters().getParameterValue("start").toString())
      .toDateMidnight();
    DateMidnight end = fmt.parseDateTime(r.getRequestParameters().getParameterValue("end").toString())
      .toDateMidnight();
    DateMidnight visibleStart = fmt.parseDateTime(
      r.getRequestParameters().getParameterValue("visibleStart").toString()).toDateMidnight();
    DateMidnight visibleEnd = fmt
      .parseDateTime(r.getRequestParameters().getParameterValue("visibleEnd").toString()).toDateMidnight();
    View view = new View(type, start, end, visibleStart, visibleEnd);
    CalendarResponse response = new CalendarResponse(getCalendar(), target);
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

      .toDateMidnight();
    DateMidnight end = fmt.parseDateTime(r.getRequestParameters().getParameterValue("end").toString())
      .toDateMidnight();
    DateMidnight visibleStart = fmt.parseDateTime(
      r.getRequestParameters().getParameterValue("visibleStart").toString()).toDateMidnight();
    DateMidnight visibleEnd = fmt
      .parseDateTime(r.getRequestParameters().getParameterValue("visibleEnd").toString()).toDateMidnight();
    View view = new View(type, start, end, visibleStart, visibleEnd);
    CalendarResponse response = new CalendarResponse(getCalendar(), target);
    onViewDisplayed(view, response);
  }
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

     *            an ISO8601 formatted String (non millis)
     * @return a DateTime instance at midnight in "Market time"
     */
    public static DateTime isoDayToDateTime(final String day) {
        final DateTimeFormatter fmt = isoFormat.withZone(marketTimeZone);
        final DateTime parsed = fmt.parseDateTime(day);
        // set to start of day
        final DateTime result = parsed.withMillisOfDay(0);
        return result;
    }

View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

        // Import the data
        int count = 0;
        while ((nextLine = csvReader.readNext()) != null) {
            // The first value is always a date.
            long time = dtf.parseDateTime(nextLine[0]).getMillis();

            // The rest of the values are point samples.
            for (int i = 1; i < nextLine.length; i++) {
                DataValue value = DataValue.stringToValue(nextLine[i], vos[i - 1].getPointLocator().getDataTypeId());
                PointValueTime pvt = new PointValueTime(value, time);
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

      format = format.withZone(getTimeZone());

      try
      {
        // parse date retaining the time of the submission
        dateTime = format.parseDateTime(value);
      }
      catch (RuntimeException e)
      {
        throw new ConversionException(e);
      }
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

    }
    else
    {
      try
      {
        DateTime date = format.parseDateTime(value);
        return date.toDate();
      }
      catch (RuntimeException e)
      {
        throw new ConversionException(e);
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

        String date = input.get(0).toString();
        String format = input.get(1).toString();

        // See http://joda-time.sourceforge.net/api-release/org/joda/time/format/DateTimeFormat.html
        DateTimeFormatter parser = DateTimeFormat.forPattern(format);
        DateTime result = parser.parseDateTime(date);

        return result.toString();
    }

  @Override
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

      format = format.withZone(getTimeZone());       

      try
      {
        // parse date retaining the time of the submission
        dateTime = format.parseDateTime(value);       
      }
      catch (RuntimeException e)
      {
        throw new ConversionException(e);
      }
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()

    }
    else
    {
      try
      {
        DateTime date = format.parseDateTime(value);
        return date.toDate();
      }
      catch (RuntimeException e)
      {
        throw new ConversionException(e);
View Full Code Here

Examples of org.joda.time.format.DateTimeFormatter.parseDateTime()


  private void verifyFormat(String x, String format, DateTime dateTime) {
    DateTimeFormatter formatter = DateTimeFormat.forPattern(format);
    assertThat(formatter.print(dateTime), equalTo(x));
    assertThat(formatter.parseDateTime(x), equalTo(dateTime));
  }
 
}
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.