本文整理匯總了Java中org.joda.time.DateTimeUtils.getDurationMillis方法的典型用法代碼示例。如果您正苦於以下問題:Java DateTimeUtils.getDurationMillis方法的具體用法?Java DateTimeUtils.getDurationMillis怎麽用?Java DateTimeUtils.getDurationMillis使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.joda.time.DateTimeUtils
的用法示例。
在下文中一共展示了DateTimeUtils.getDurationMillis方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: BaseInterval
import org.joda.time.DateTimeUtils; //導入方法依賴的package包/類
/**
* Constructs an interval from a start instant and a duration.
*
* @param start start of this interval, null means now
* @param duration the duration of this interval, null means zero length
* @throws IllegalArgumentException if the end is before the start
* @throws ArithmeticException if the end instant exceeds the capacity of a long
*/
protected BaseInterval(ReadableInstant start, ReadableDuration duration) {
super();
iChronology = DateTimeUtils.getInstantChronology(start);
iStartMillis = DateTimeUtils.getInstantMillis(start);
long durationMillis = DateTimeUtils.getDurationMillis(duration);
iEndMillis = FieldUtils.safeAdd(iStartMillis, durationMillis);
checkInterval(iStartMillis, iEndMillis);
}
示例2: BasePeriod
import org.joda.time.DateTimeUtils; //導入方法依賴的package包/類
/**
* Creates a period from the given start point and duration.
*
* @param startInstant the interval start, null means now
* @param duration the duration of the interval, null means zero-length
* @param type which set of fields this period supports, null means standard
*/
protected BasePeriod(ReadableInstant startInstant, ReadableDuration duration, PeriodType type) {
super();
type = checkPeriodType(type);
long startMillis = DateTimeUtils.getInstantMillis(startInstant);
long durationMillis = DateTimeUtils.getDurationMillis(duration);
long endMillis = FieldUtils.safeAdd(startMillis, durationMillis);
Chronology chrono = DateTimeUtils.getInstantChronology(startInstant);
iType = type;
iValues = chrono.get(this, startMillis, endMillis);
}