Example usage for org.joda.time Hours toStandardMinutes

List of usage examples for org.joda.time Hours toStandardMinutes

Introduction

In this page you can find the example usage for org.joda.time Hours toStandardMinutes.

Prototype

public Minutes toStandardMinutes() 

Source Link

Document

Converts this period in hours to a period in minutes assuming a 60 minute hour.

Usage

From source file:ca.barrenechea.ticker.utils.TimeUtils.java

License:Apache License

public static TimeSpan getSpan(long start, long end) {
    if (end <= start) {
        return new TimeSpan(0, 0, 0);
    }/* www.j av  a 2  s .  c  o  m*/

    Interval interval = new Interval(start, end);

    Days days = Days.daysIn(interval);
    Hours hours = Hours.hoursIn(interval).minus(days.toStandardHours());
    Minutes minutes = Minutes.minutesIn(interval).minus(days.toStandardMinutes())
            .minus(hours.toStandardMinutes());

    return new TimeSpan(days.getDays(), hours.getHours(), minutes.getMinutes());
}