Example usage for org.joda.time Duration toPeriod

List of usage examples for org.joda.time Duration toPeriod

Introduction

In this page you can find the example usage for org.joda.time Duration toPeriod.

Prototype

public Period toPeriod() 

Source Link

Document

Converts this duration to a Period instance using the standard period type and the ISO chronology.

Usage

From source file:uk.ac.susx.tag.method51.core.params.codec.concrete.DurationCodec.java

License:Apache License

@Override
public String encodeString(Duration value) throws EncodeException {

    try {//from www.j  av a2s  . c  o  m
        return ISOPeriodFormat.standard().print(value.toPeriod().normalizedStandard());
    } catch (IllegalArgumentException e) {
        throw new EncodeException(e);
    }
}