List of usage examples for org.joda.time Period years
public static Period years(int years)
From source file:org.openvpms.archetype.rules.util.DateUnits.java
License:Open Source License
/** * Converts a value in the units to a {@code Period}. * * @param value the value//from w w w . j av a 2 s .c om * @return a new period */ public Period toPeriod(int value) { switch (this) { case MINUTES: return Period.minutes(value); case HOURS: return Period.hours(value); case DAYS: return Period.days(value); case WEEKS: return Period.weeks(value); case MONTHS: return Period.months(value); default: return Period.years(value); } }