当前位置: 首页>>代码示例>>Java>>正文


Java BaseSingleFieldPeriod.standardPeriodIn方法代码示例

本文整理汇总了Java中org.joda.time.base.BaseSingleFieldPeriod.standardPeriodIn方法的典型用法代码示例。如果您正苦于以下问题:Java BaseSingleFieldPeriod.standardPeriodIn方法的具体用法?Java BaseSingleFieldPeriod.standardPeriodIn怎么用?Java BaseSingleFieldPeriod.standardPeriodIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.joda.time.base.BaseSingleFieldPeriod的用法示例。


在下文中一共展示了BaseSingleFieldPeriod.standardPeriodIn方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: standardPeriodIn

import org.joda.time.base.BaseSingleFieldPeriod; //导入方法依赖的package包/类
public static int standardPeriodIn(ReadablePeriod period, long millisPerUnit) {
    return BaseSingleFieldPeriod.standardPeriodIn(period, millisPerUnit);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:4,代码来源:TestBaseSingleFieldPeriod.java

示例2: standardMinutesIn

import org.joda.time.base.BaseSingleFieldPeriod; //导入方法依赖的package包/类
/**
 * Creates a new <code>Minutes</code> representing the number of complete
 * standard length minutes in the specified period.
 * <p>
 * This factory method converts all fields from the period to minutes using standardised
 * durations for each field. Only those fields which have a precise duration in
 * the ISO UTC chronology can be converted.
 * <ul>
 * <li>One week consists of 7 days.
 * <li>One day consists of 24 hours.
 * <li>One hour consists of 60 minutes.
 * <li>One minute consists of 60 seconds.
 * <li>One second consists of 1000 milliseconds.
 * </ul>
 * Months and Years are imprecise and periods containing these values cannot be converted.
 *
 * @param period  the period to get the number of minutes from, null returns zero
 * @return the period in minutes
 * @throws IllegalArgumentException if the period contains imprecise duration values
 */
public static Minutes standardMinutesIn(ReadablePeriod period) {
    int amount = BaseSingleFieldPeriod.standardPeriodIn(period, DateTimeConstants.MILLIS_PER_MINUTE);
    return Minutes.minutes(amount);
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:25,代码来源:Minutes.java

示例3: standardWeeksIn

import org.joda.time.base.BaseSingleFieldPeriod; //导入方法依赖的package包/类
/**
 * Creates a new <code>Weeks</code> representing the number of complete
 * standard length weeks in the specified period.
 * <p>
 * This factory method converts all fields from the period to hours using standardised
 * durations for each field. Only those fields which have a precise duration in
 * the ISO UTC chronology can be converted.
 * <ul>
 * <li>One week consists of 7 days.
 * <li>One day consists of 24 hours.
 * <li>One hour consists of 60 minutes.
 * <li>One minute consists of 60 weeks.
 * <li>One second consists of 1000 milliseconds.
 * </ul>
 * Months and Years are imprecise and periods containing these values cannot be converted.
 *
 * @param period  the period to get the number of hours from, null returns zero
 * @return the period in weeks
 * @throws IllegalArgumentException if the period contains imprecise duration values
 */
public static Weeks standardWeeksIn(ReadablePeriod period) {
    int amount = BaseSingleFieldPeriod.standardPeriodIn(period, DateTimeConstants.MILLIS_PER_WEEK);
    return Weeks.weeks(amount);
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:25,代码来源:Weeks.java

示例4: standardSecondsIn

import org.joda.time.base.BaseSingleFieldPeriod; //导入方法依赖的package包/类
/**
 * Creates a new <code>Seconds</code> representing the number of complete
 * standard length seconds in the specified period.
 * <p>
 * This factory method converts all fields from the period to hours using standardised
 * durations for each field. Only those fields which have a precise duration in
 * the ISO UTC chronology can be converted.
 * <ul>
 * <li>One week consists of 7 seconds.
 * <li>One day consists of 24 hours.
 * <li>One hour consists of 60 minutes.
 * <li>One minute consists of 60 seconds.
 * <li>One second consists of 1000 milliseconds.
 * </ul>
 * Months and Years are imprecise and periods containing these values cannot be converted.
 *
 * @param period  the period to get the number of hours from, null returns zero
 * @return the period in seconds
 * @throws IllegalArgumentException if the period contains imprecise duration values
 */
public static Seconds standardSecondsIn(ReadablePeriod period) {
    int amount = BaseSingleFieldPeriod.standardPeriodIn(period, DateTimeConstants.MILLIS_PER_SECOND);
    return Seconds.seconds(amount);
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:25,代码来源:Seconds.java

示例5: standardDaysIn

import org.joda.time.base.BaseSingleFieldPeriod; //导入方法依赖的package包/类
/**
 * Creates a new <code>Days</code> representing the number of complete
 * standard length days in the specified period.
 * <p>
 * This factory method converts all fields from the period to hours using standardised
 * durations for each field. Only those fields which have a precise duration in
 * the ISO UTC chronology can be converted.
 * <ul>
 * <li>One week consists of 7 days.
 * <li>One day consists of 24 hours.
 * <li>One hour consists of 60 minutes.
 * <li>One minute consists of 60 seconds.
 * <li>One second consists of 1000 milliseconds.
 * </ul>
 * Months and Years are imprecise and periods containing these values cannot be converted.
 *
 * @param period  the period to get the number of hours from, null returns zero
 * @return the period in days
 * @throws IllegalArgumentException if the period contains imprecise duration values
 */
public static Days standardDaysIn(ReadablePeriod period) {
    int amount = BaseSingleFieldPeriod.standardPeriodIn(period, DateTimeConstants.MILLIS_PER_DAY);
    return Days.days(amount);
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:25,代码来源:Days.java

示例6: standardHoursIn

import org.joda.time.base.BaseSingleFieldPeriod; //导入方法依赖的package包/类
/**
 * Creates a new <code>Hours</code> representing the number of complete
 * standard length hours in the specified period.
 * <p>
 * This factory method converts all fields from the period to hours using standardised
 * durations for each field. Only those fields which have a precise duration in
 * the ISO UTC chronology can be converted.
 * <ul>
 * <li>One week consists of 7 days.
 * <li>One day consists of 24 hours.
 * <li>One hour consists of 60 minutes.
 * <li>One minute consists of 60 seconds.
 * <li>One second consists of 1000 milliseconds.
 * </ul>
 * Months and Years are imprecise and periods containing these values cannot be converted.
 *
 * @param period  the period to get the number of hours from, null returns zero
 * @return the period in hours
 * @throws IllegalArgumentException if the period contains imprecise duration values
 */
public static Hours standardHoursIn(ReadablePeriod period) {
    int amount = BaseSingleFieldPeriod.standardPeriodIn(period, DateTimeConstants.MILLIS_PER_HOUR);
    return Hours.hours(amount);
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:25,代码来源:Hours.java


注:本文中的org.joda.time.base.BaseSingleFieldPeriod.standardPeriodIn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。