List of usage examples for org.joda.time.format PeriodFormatterBuilder printZeroAlways
public PeriodFormatterBuilder printZeroAlways()
From source file:ch.eitchnet.android.util.JodaHelper.java
License:Open Source License
public static String toHourMinute(Duration duration) { PeriodFormatterBuilder builder = new PeriodFormatterBuilder(); builder.printZeroAlways(); if (duration.isShorterThan(Duration.ZERO)) builder.appendLiteral("-"); builder.minimumPrintedDigits(2).appendHours().appendLiteral(":").minimumPrintedDigits(2).appendMinutes(); return builder.toFormatter().print(new Period(Math.abs(duration.getMillis()))); }