예제 #1
0
파일: TypeUtil.java 프로젝트: nkhuyu/jpmml
  @SuppressWarnings(value = {"deprecation"})
  private static Seconds parseSeconds(String value) {
    DateTimeFormatter format = SecondsSinceMidnight.getFormat();

    DateTimeParser parser = format.getParser();

    DateTimeParserBucket bucket = new DateTimeParserBucket(0, null, null);
    bucket.setZone(null);

    int result = parser.parseInto(bucket, value, 0);
    if (result >= 0 && result >= value.length()) {
      long millis = bucket.computeMillis(true);

      return Seconds.seconds((int) (millis / 1000L));
    }

    throw new IllegalArgumentException(value);
  }
예제 #2
0
파일: Helpers.java 프로젝트: mnylen/ohtu11k
 public static String toFinnishDate(DateTime dt) {
   return finnishDate.print(dt);
 }