Examples of LocalTime


Examples of org.joda.time.LocalTime

    @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

Examples of org.joda.time.LocalTime

        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

Examples of org.joda.time.LocalTime

  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

Examples of org.joda.time.LocalTime

    }

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

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

Examples of org.joda.time.LocalTime

      return dt;
    }

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

Examples of org.joda.time.LocalTime

import org.joda.time.LocalTime;

public class LocalTimePropertyEditor extends PropertyEditorSupport {
  public void setAsText(String text) throws IllegalArgumentException {
    setValue(new LocalTime(text));
  }
View Full Code Here

Examples of org.joda.time.LocalTime

  {
    JodaTimeTranslators.add(fact());
    fact().register(HasJoda.class);

    HasJoda hj = new HasJoda();
    hj.localTime = new LocalTime();
    hj.localDate = new LocalDate();
    hj.localDateTime = new LocalDateTime();
    hj.dateTime = new DateTime();
    hj.dateTimeZone = DateTimeZone.forID("America/Los_Angeles");
    hj.yearMonth = new YearMonth();
View Full Code Here

Examples of org.joda.time.LocalTime

        assertEquals(new LocalDate(2016, 1, 4, chrono), f.parseLocalDate("2016-01-01"));
    }

    //-----------------------------------------------------------------------
    public void testParseLocalTime_simple() {
        assertEquals(new LocalTime(10, 20, 30), g.parseLocalTime("2004-06-09T10:20:30Z"));
        assertEquals(new LocalTime(10, 20, 30), g.parseLocalTime("2004-06-09T10:20:30+18:00"));
        assertEquals(new LocalTime(10, 20, 30), g.parseLocalTime("2004-06-09T10:20:30-18:00"));
        assertEquals(new LocalTime(10, 20, 30, 0, BUDDHIST_PARIS),
                g.withChronology(BUDDHIST_PARIS).parseLocalTime("2004-06-09T10:20:30Z"));
        try {
            g.parseDateTime("ABC");
            fail();
        } catch (IllegalArgumentException ex) {}
View Full Code Here

Examples of org.joda.time.LocalTime

   
    return formatter.format(Math.round(number * 100)) + "%";
  }
 
  public static String toTimeString(Integer seconds){
    return new LocalTime(0,
               seconds / 60,
               seconds % 60).toString("mm:ss");
  }
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.