Package org.joda.time

Examples of org.joda.time.LocalTime


    return v.toString();
  }

  @Override
  public LocalTime parse(String value) {
    return new LocalTime(value);
  }
View Full Code Here


    }
  }

  @Override
  public LocalTime parseDateTime(long systemTimeMillis) {
    return new LocalTime(systemTimeMillis);
  }
View Full Code Here

        checkValue(path, node, "a time");
        if (!node.isTextual()) {
            throw new IllegalArgumentException(formatExMsg(path, "is not a time"));
        }
        final String textValue = node.getTextValue();
        final LocalTime localTime = _HHmmss.parseLocalTime(textValue + "Z");
        return new java.util.Date(localTime.getMillisOfDay());
    }
View Full Code Here

                    case "bound_double":
                        return 12.34;
                    case "bound_date":
                        return new LocalDate(2001, 8, 22).toDateMidnight(DateTimeZone.UTC).getMillis();
                    case "bound_time":
                        return new LocalTime(3, 4, 5, 321).toDateTime(new DateTime(0, DateTimeZone.UTC)).getMillis();
                    case "bound_timestamp":
                        return new DateTime(2001, 8, 22, 3, 4, 5, 321, DateTimeZone.UTC).getMillis();
                    case "bound_pattern":
                        return Slices.wrappedBuffer("%el%".getBytes(UTF_8));
                }
View Full Code Here

    @Test
    public void testLocalTime()
            throws Exception
    {
        long millis = new LocalTime(session.getStartTime(), DATE_TIME_ZONE).getMillisOfDay();
        functionAssertions.assertFunction("LOCALTIME", toTime(millis));
    }
View Full Code Here

    @Test
    public void testCurrentTime()
            throws Exception
    {
        long millis = new LocalTime(session.getStartTime(), DATE_TIME_ZONE).getMillisOfDay();
        functionAssertions.assertFunction("CURRENT_TIME", new SqlTimeWithTimeZone(millis, session.getTimeZoneKey()));
    }
View Full Code Here

        fmt = ISODateTimeFormat.date();
        LocalDate localDate = fmt.parseLocalDate(constant.toString());
        return StandardConverters.convertToBytes(localDate);
      } else if (info.getClassType().getName().equals("org.joda.time.LocalTime")) {
        fmt = ISODateTimeFormat.time();
        LocalTime localTime = fmt.parseLocalTime(constant.toString());
        return StandardConverters.convertToBytes(localTime);
      }
    }
    return info.convertToStorage2(constant);
  }
View Full Code Here

  public static class LocalTimeConverter extends BaseConverter {
    private DateTimeFormatter fmt = ISODateTimeFormat.time();
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      LocalTime dt = (LocalTime) value;
      long milliseconds = dt.getMillisOfDay();
      return StandardConverters.convertToBytes(milliseconds);
    }
View Full Code Here

    }

    @Override
    public Object convertFromNoSqlImpl(byte[] value) {
      Long time = StandardConverters.convertFromBytes(Long.class, value);
      LocalTime dt = LocalTime.fromMillisOfDay(time);
      return dt;
    }
View Full Code Here

      return dt;
    }

    @Override
    protected Object convertToType(String value) {
      LocalTime dt = fmt.parseLocalTime(value);
      return dt;
    }
View Full Code Here

TOP

Related Classes of org.joda.time.LocalTime

Copyright © 2018 www.massapicom. 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.