Examples of LocalTime


Examples of com.facebook.presto.jdbc.internal.joda.time.LocalTime

                    jp.nextToken(); // END_ARRAY?
                }
                if (jp.getCurrentToken() != JsonToken.END_ARRAY) {
                    throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY, "after LocalTime ints");
                }
                return new LocalTime(hour, minute, second, millis);
            }
            break;
        case VALUE_NUMBER_INT:
            return new LocalTime(jp.getLongValue());           
        case VALUE_STRING:
            String str = jp.getText().trim();
            if (str.length() == 0) { // [JACKSON-360]
                return null;
            }
View Full Code Here

Examples of java.time.LocalTime

   * @return
   */
  public static LocalTime createLocalTimeFromCalendar(Calendar calendar)
  {
    if (calendar == null) return null;
    LocalTime lLocalTime = LocalTime.of(calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND), calendar.get(Calendar.MILLISECOND) * 1000000);
    return lLocalTime;
  }
View Full Code Here

Examples of java.time.LocalTime

   */
  public static LocalTime createLocaleTimeFromDate(Date date) {
    if (date == null) {
      return null;
    }
    LocalTime lLocalTime = LocalTime.of( date.getHours(), date.getMinutes(), date.getSeconds(), 0 );
    return lLocalTime;
  }
View Full Code Here

Examples of java.time.LocalTime

    }
    final private DateTimeFormatter dateTimeFormatter;
   
    @Override
    public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
      LocalTime lLocalTime = createLocaleTimeFromDate(date);
      String s = this.dateTimeFormatter.format( lLocalTime );
      toAppendTo.append(s);
      return toAppendTo;
    }
View Full Code Here

Examples of javax.time.calendar.LocalTime

        ParsePosition pp = new ParsePosition(pos);
        DateTimeParseContext cal = f.parse(str, pp);
        if (pp.getErrorIndex() >= 0) {
            throw new IllegalArgumentException(str);
        }
        LocalTime time = cal.toCalendricalMerger().merge().get(LocalTime.rule());
        int secs = time.getHourOfDay() * 60 * 60 +
                time.getMinuteOfHour() * 60 + time.getSecondOfMinute();
        if (pos == 1) {
            secs = -secs;
        }
        return secs;
    }
View Full Code Here

Examples of org.joda.time.LocalTime

     */
    public static LocalTime deserializeLocalTime(String text) throws JiBXException {
        if (text == null) {
            return null;
        } else {
            return new LocalTime(Utility.parseTimeNoOffset(text, 0, text.length()), DateTimeZone.UTC);
        }
    }
View Full Code Here

Examples of org.joda.time.LocalTime

        assertEquals("2008-03-01Z", JodaConvert.serializeUTCDateMidnight(new DateMidnight(2008, 3, 1, DateTimeZone.UTC)));
    }
   
    public void testDeserializeLocalTime() throws JiBXException {
        assertNull("Null input", JodaConvert.deserializeLocalTime(null));
        LocalTime time = JodaConvert.deserializeLocalTime("01:02:03Z");
        assertEquals("Wrong value", 1, time.getHourOfDay());
        assertEquals("Wrong value", 2, time.getMinuteOfHour());
        assertEquals("Wrong value", 3, time.getSecondOfMinute());
        time = JodaConvert.deserializeLocalTime("02:05:06.123-02:00");
        assertEquals("Wrong value", 2, time.getHourOfDay());
        assertEquals("Wrong value", 5, time.getMinuteOfHour());
        assertEquals("Wrong value", 6, time.getSecondOfMinute());
        assertEquals("Wrong value", 123, time.getMillisOfSecond());
        time = JodaConvert.deserializeLocalTime("02:05:06.123");
        assertEquals("Wrong value", 2, time.getHourOfDay());
        assertEquals("Wrong value", 5, time.getMinuteOfHour());
        assertEquals("Wrong value", 6, time.getSecondOfMinute());
        assertEquals("Wrong value", 123, time.getMillisOfSecond());
        time = JodaConvert.deserializeLocalTime("24:00:00");
        assertEquals("Wrong value", 0, time.getHourOfDay());
        assertEquals("Wrong value", 0, time.getMinuteOfHour());
        assertEquals("Wrong value", 0, time.getSecondOfMinute());
        try {
            JodaConvert.deserializeLocalTime("24:05:06.123-02:00");
            fail("Invalid hour number");
        } catch (JiBXException ex) {}
        try {
View Full Code Here

Examples of org.joda.time.LocalTime

            fail("Invalid second number");
        } catch (JiBXException ex) {}
    }
   
    public void testSerializeUnzonedLocalTime() throws JiBXException {
        assertEquals("01:02:03", JodaConvert.serializeUnzonedLocalTime(new LocalTime(1, 2, 3)));
        assertEquals("23:59:59", JodaConvert.serializeUnzonedLocalTime(new LocalTime(23, 59, 59)));
        assertEquals("00:00:00.123", JodaConvert.serializeUnzonedLocalTime(new LocalTime(0, 0, 0, 123)));
    }
View Full Code Here

Examples of org.joda.time.LocalTime

        assertEquals("23:59:59", JodaConvert.serializeUnzonedLocalTime(new LocalTime(23, 59, 59)));
        assertEquals("00:00:00.123", JodaConvert.serializeUnzonedLocalTime(new LocalTime(0, 0, 0, 123)));
    }
   
    public void testSerializeUTCLocalTime() throws JiBXException {
        assertEquals("01:02:03Z", JodaConvert.serializeUTCLocalTime(new LocalTime(1, 2, 3)));
        assertEquals("23:59:59Z", JodaConvert.serializeUTCLocalTime(new LocalTime(23, 59, 59)));
        assertEquals("00:00:00.123Z", JodaConvert.serializeUTCLocalTime(new LocalTime(0, 0, 0, 123)));
    }
View Full Code Here

Examples of org.joda.time.LocalTime

    protected void setUp() throws Exception {
        weeks = DurationFieldType.weeks();
        months = DurationFieldType.months();
        dateTimeFieldTypeOne = DateTimeFieldType.centuryOfEra();
        localTime = new LocalTime();
    }
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.