Package org.joda.time

Examples of org.joda.time.LocalTime


      return dt;
    }

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


      return dt;
    }

    @Override
    protected String convertToString(Object value) {
      LocalTime dt = (LocalTime) value;
      return fmt.print(dt);
    }
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

    private IssueTimeType issueTimeType = new IssueTimeType();

    public InvoiceType process(InvoiceType invoiceType, UBL4JConfigurationBean ubl4JConfigurationBean) throws FailedToProcessException {
        try {
            issueTimeType.setValue(CalendarUtil.toCalendar(new LocalTime()));
        } catch (DatatypeConfigurationException e) {
            throw new FailedToProcessException(e);
        }
        invoiceType.setIssueTime(issueTimeType);
        return invoiceType;
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

        boolean fr = getBoolean(dbo, "fr");
        boolean sa = getBoolean(dbo, "sa");
        boolean ignoreWarn = getOptionalBoolean(dbo, "ignoreWarn", false);
        boolean ignoreError = getOptionalBoolean(dbo, "ignoreError", false);
        boolean ignoreOk = getOptionalBoolean(dbo, "ignoreOk", false);
        LocalTime fromTime = getLocalTime(dbo, "fromHour", "fromMin");
        LocalTime toTime = getLocalTime(dbo, "toHour", "toMin");
        boolean enabled = getBoolean(dbo, "enabled");
       
        return new Subscription()
                .withId(id)
                .withTarget(target)
View Full Code Here

    }
   
    private LocalTime getLocalTime(DBObject dbo, String hourKey, String minKey) {
        Integer hour = getInteger(dbo, hourKey);
        Integer min = getInteger(dbo, minKey);
        return (hour == null || min == null) ? null : new LocalTime(hour, min);
    }
View Full Code Here

        if (raw == null || raw.length() != 4) {
            return null;
        }
        int hours = Integer.valueOf(raw.substring(0, 2));
        int mins = Integer.valueOf(raw.substring(2));
        return new LocalTime(hours, mins);
    }
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.