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


Java DateTimeConstants.MILLIS_PER_MINUTE屬性代碼示例

本文整理匯總了Java中org.joda.time.DateTimeConstants.MILLIS_PER_MINUTE屬性的典型用法代碼示例。如果您正苦於以下問題:Java DateTimeConstants.MILLIS_PER_MINUTE屬性的具體用法?Java DateTimeConstants.MILLIS_PER_MINUTE怎麽用?Java DateTimeConstants.MILLIS_PER_MINUTE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.joda.time.DateTimeConstants的用法示例。


在下文中一共展示了DateTimeConstants.MILLIS_PER_MINUTE屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: millisPerUnit

private static int millisPerUnit(String unit) {
  switch (Ascii.toLowerCase(unit)) {
    case "d":
      return DateTimeConstants.MILLIS_PER_DAY;
    case "h":
      return DateTimeConstants.MILLIS_PER_HOUR;
    case "m":
      return DateTimeConstants.MILLIS_PER_MINUTE;
    case "s":
      return DateTimeConstants.MILLIS_PER_SECOND;
    case "ms":
      return 1;
    default:
      throw new IllegalArgumentException("Unknown duration unit " + unit);
  }
}
 
開發者ID:GoogleCloudPlatform,項目名稱:pubsub,代碼行數:16,代碼來源:Driver.java

示例2: getDateTimeMillis

public long getDateTimeMillis(
        int year, int monthOfYear, int dayOfMonth,
        int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
        throws IllegalArgumentException {
    Chronology base;
    if ((base = getBase()) != null) {
        return base.getDateTimeMillis(year, monthOfYear, dayOfMonth,
                                      hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond);
    }

    FieldUtils.verifyValueBounds(DateTimeFieldType.hourOfDay(), hourOfDay, 0, 23);
    FieldUtils.verifyValueBounds(DateTimeFieldType.minuteOfHour(), minuteOfHour, 0, 59);
    FieldUtils.verifyValueBounds(DateTimeFieldType.secondOfMinute(), secondOfMinute, 0, 59);
    FieldUtils.verifyValueBounds(DateTimeFieldType.millisOfSecond(), millisOfSecond, 0, 999);

    return getDateMidnightMillis(year, monthOfYear, dayOfMonth)
        + hourOfDay * DateTimeConstants.MILLIS_PER_HOUR
        + minuteOfHour * DateTimeConstants.MILLIS_PER_MINUTE
        + secondOfMinute * DateTimeConstants.MILLIS_PER_SECOND
        + millisOfSecond;
}
 
開發者ID:redfish64,項目名稱:TinyTravelTracker,代碼行數:21,代碼來源:BasicChronology.java

示例3: shareScheduledMessages

@Scheduled(fixedRate=DateTimeConstants.MILLIS_PER_MINUTE)
@SqlTransactional
public void shareScheduledMessages() {
    while (true) {
        if (queue.isEmpty()) {
            break;
        }
        DateTime messageTime = queue.peek().getScheduledTime();
        // send messages whose time is before the current moment. This job runs every minute,
        // so the maximum delay for a message will be 1 minute
        if (messageTime.isBeforeNow()) {
            ScheduledMessage msg = queue.poll();
            shareService.share(msg.getText(),
                    msg.getUserId(),
                    Arrays.asList(StringUtils.split(msg.getPictureUrls(), DELIMITER)),
                    Arrays.asList(StringUtils.split(msg.getExternalSites(), DELIMITER)),
                    Arrays.asList(StringUtils.split(msg.getHideFromUsernames(), DELIMITER)),
                    msg.isHideFromCloseFriends());

            shareService.delete(msg);
        } else {
            break;
        }
    }
}
 
開發者ID:Glamdring,項目名稱:welshare,代碼行數:25,代碼來源:ScheduledMessagesJob.java

示例4: printTo

public void printTo(
        StringBuffer buf, long instant, Chronology chrono,
        int displayOffset, DateTimeZone displayZone, Locale locale) {
    if (displayZone == null) {
        return;  // no zone
    }
    if (displayOffset == 0 && iZeroOffsetPrintText != null) {
        buf.append(iZeroOffsetPrintText);
        return;
    }
    if (displayOffset >= 0) {
        buf.append('+');
    } else {
        buf.append('-');
        displayOffset = -displayOffset;
    }

    int hours = displayOffset / DateTimeConstants.MILLIS_PER_HOUR;
    FormatUtils.appendPaddedInteger(buf, hours, 2);
    if (iMaxFields == 1) {
        return;
    }
    displayOffset -= hours * (int)DateTimeConstants.MILLIS_PER_HOUR;
    if (displayOffset == 0 && iMinFields <= 1) {
        return;
    }

    int minutes = displayOffset / DateTimeConstants.MILLIS_PER_MINUTE;
    if (iShowSeparators) {
        buf.append(':');
    }
    FormatUtils.appendPaddedInteger(buf, minutes, 2);
    if (iMaxFields == 2) {
        return;
    }
    displayOffset -= minutes * DateTimeConstants.MILLIS_PER_MINUTE;
    if (displayOffset == 0 && iMinFields <= 2) {
        return;
    }

    int seconds = displayOffset / DateTimeConstants.MILLIS_PER_SECOND;
    if (iShowSeparators) {
        buf.append(':');
    }
    FormatUtils.appendPaddedInteger(buf, seconds, 2);
    if (iMaxFields == 3) {
        return;
    }
    displayOffset -= seconds * DateTimeConstants.MILLIS_PER_SECOND;
    if (displayOffset == 0 && iMinFields <= 3) {
        return;
    }

    if (iShowSeparators) {
        buf.append('.');
    }
    FormatUtils.appendPaddedInteger(buf, displayOffset, 3);
}
 
開發者ID:redfish64,項目名稱:TinyTravelTracker,代碼行數:58,代碼來源:DateTimeFormatterBuilder.java


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