Examples of parseDateTime()


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

        }
        final String timeZoneID = TimeZone.getDefault().getID();
        for (final DateTimeFormatter element : formattersNoUTC) {
            try {
                final DateTimeFormatter formatter = element.withZone(DateTimeZone.forID(timeZoneID));
                final DateTime dt = formatter.parseDateTime(str);
                final Calendar calendar = dt.toGregorianCalendar();
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (final IllegalArgumentException e) {
                // try with next formatter
View Full Code Here

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

            DateTime dt = null;
            String text = getLabelElement().getText();
            String timeStamp = text.substring(text.indexOf('[') + 1, text.indexOf(']'));
            DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:m:s.S");
            try {
                dt = formatter.parseDateTime(timeStamp);
            } catch (IllegalArgumentException e) {
                throw new RuntimeException("Something went wrong with parsing of log entry timestamp!", e);
            }
            return dt;
        }
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()

    public Object fromString(String str) {
        for (int i = 0; i < formattersUTC.length; i++) {
            DateTimeFormatter formatter = formattersUTC[i];
            try {
                DateTime dt = formatter.parseDateTime(str);
                Calendar calendar = dt.toCalendar(Locale.getDefault());
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (IllegalArgumentException e) {
                // try with next formatter
View Full Code Here

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

        }
        String timeZoneID = TimeZone.getDefault().getID();
        for (int i = 0; i < formattersNoUTC.length; i++) {
            try {
                DateTimeFormatter formatter = formattersNoUTC[i].withZone(DateTimeZone.forID(timeZoneID));
                DateTime dt = formatter.parseDateTime(str);
                Calendar calendar = dt.toCalendar(Locale.getDefault());
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (IllegalArgumentException e) {
                // try with next formatter
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()

      dt.setZone(getTimeZone());
      return dt.toDate();
    }
    else
    {
      return format.parseDateTime(value).toDate();
    }
  }

  /**
   * @see org.apache.wicket.util.convert.IConverter#convertToString(java.lang.Object,
View Full Code Here

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

    public Object fromString(String str) {
        for (int i = 0; i < formattersUTC.length; i++ ) {
            DateTimeFormatter formatter = formattersUTC[i];
            try {
                DateTime dt = formatter.parseDateTime(str);
                Calendar calendar = dt.toCalendar(Locale.getDefault());
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (IllegalArgumentException e) {
                // try with next formatter
View Full Code Here

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

        }
        String timeZoneID = TimeZone.getDefault().getID();
        for (int i = 0; i < formattersNoUTC.length; i++ ) {
            try {
                DateTimeFormatter formatter = formattersNoUTC[i].withZone(DateTimeZone.forID(timeZoneID));
                DateTime dt = formatter.parseDateTime(str);
                Calendar calendar = dt.toCalendar(Locale.getDefault());
                calendar.setTimeZone(TimeZone.getDefault());
                return calendar;
            } catch (IllegalArgumentException e) {
                // try with next formatter
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
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.