Example usage for org.joda.time.format DateTimeFormatterBuilder appendSignedDecimal

List of usage examples for org.joda.time.format DateTimeFormatterBuilder appendSignedDecimal

Introduction

In this page you can find the example usage for org.joda.time.format DateTimeFormatterBuilder appendSignedDecimal.

Prototype

public DateTimeFormatterBuilder appendSignedDecimal(DateTimeFieldType fieldType, int minDigits, int maxDigits) 

Source Link

Document

Instructs the printer to emit a field value as a decimal number, and the parser to expect a signed decimal number.

Usage

From source file:org.jpmml.evaluator.SecondsSinceMidnight.java

License:Open Source License

static private DateTimeFormatter createFormat() {
    DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
    builder = builder.appendSignedDecimal(HoursOfEpochFieldType.getInstance(), 1, 4).appendLiteral(':')
            .appendFixedDecimal(DateTimeFieldType.minuteOfHour(), 2).appendLiteral(':')
            .appendFixedDecimal(DateTimeFieldType.secondOfMinute(), 2);

    return builder.toFormatter();
}