當前位置: 首頁>>代碼示例>>Java>>正文


Java DateTimeUtils.getDurationMillis方法代碼示例

本文整理匯總了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);
}
 
開發者ID:redfish64,項目名稱:TinyTravelTracker,代碼行數:17,代碼來源:BaseInterval.java

示例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);
}
 
開發者ID:redfish64,項目名稱:TinyTravelTracker,代碼行數:18,代碼來源:BasePeriod.java


注:本文中的org.joda.time.DateTimeUtils.getDurationMillis方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。