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


Java DateTime.getMinuteOfHour方法代碼示例

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


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

示例1: generateNewUploadId

import org.joda.time.DateTime; //導入方法依賴的package包/類
/**
 * Creates a new uploadId from the time:
 * format("%d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, seconds);
 * @return
 */
public static String generateNewUploadId() {
    java.util.Date juDate = new Date();
    DateTime dt = new DateTime(juDate);

    StringBuilder sb = new StringBuilder();
    // Send all output to the Appendable object sb
    Formatter formatter = new Formatter(sb);


    int day = dt.getDayOfMonth();
    int month = dt.getMonthOfYear();
    int year = dt.getYear();
    int hour = dt.getHourOfDay();
    int minute = dt.getMinuteOfHour();
    int seconds = dt.getSecondOfMinute();

    formatter.format("%d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, seconds);
    return sb.toString();

}
 
開發者ID:UMM-CSci-3601-S17,項目名稱:digital-display-garden-iteration-4-revolverenguardia-1,代碼行數:26,代碼來源:ExcelParser.java

示例2: getAvailableUploadId

import org.joda.time.DateTime; //導入方法依賴的package包/類
public static String getAvailableUploadId(){

        StringBuilder sb = new StringBuilder();
        // Send all output to the Appendable object sb
        Formatter formatter = new Formatter(sb);

        java.util.Date juDate = new Date();
        DateTime dt = new DateTime(juDate);

        int day = dt.getDayOfMonth();
        int month = dt.getMonthOfYear();
        int year = dt.getYear();
        int hour = dt.getHourOfDay();
        int minute = dt.getMinuteOfHour();
        int seconds = dt.getSecondOfMinute();

        formatter.format("%d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, seconds);
        return sb.toString();

    }
 
開發者ID:UMM-CSci-3601-S17,項目名稱:digital-display-garden-iteration-3-sixguysburgers-fries,代碼行數:21,代碼來源:ImageHandler.java

示例3: getAvailableUploadId

import org.joda.time.DateTime; //導入方法依賴的package包/類
public static String getAvailableUploadId(){

        StringBuilder sb = new StringBuilder();
        // Send all output to the Appendable object sb
        Formatter formatter = new Formatter(sb);

        java.util.Date juDate = new Date();
        DateTime dt = new DateTime(juDate);

        int day = dt.getDayOfMonth();
        int month = dt.getMonthOfYear();
        int year = dt.getYear();
        int hour = dt.getHourOfDay();
        int minute = dt.getMinuteOfHour();
        int seconds = dt.getSecondOfMinute();

        formatter.format("%d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, seconds);

        allIds.add(sb.toString());
        return sb.toString();
    }
 
開發者ID:UMM-CSci-3601-S17,項目名稱:digital-display-garden-iteration-3-sixguysburgers-fries,代碼行數:22,代碼來源:ExcelParser.java

示例4: getAvailableUploadID

import org.joda.time.DateTime; //導入方法依賴的package包/類
public static String getAvailableUploadID(){

        StringBuilder sb = new StringBuilder();
        // Send all output to the Appendable object sb
        Formatter formatter = new Formatter(sb);

        java.util.Date juDate = new Date();
        DateTime dt = new DateTime(juDate);

        int day = dt.getDayOfMonth();
        int month = dt.getMonthOfYear();
        int year = dt.getYear();
        int hour = dt.getHourOfDay();
        int minute = dt.getMinuteOfHour();
        int seconds = dt.getSecondOfMinute();

        formatter.format("%d-%02d-%02d %02d:%02d:%02d", year, month, day, hour, minute, seconds);
        return sb.toString();

    }
 
開發者ID:UMM-CSci-3601-S17,項目名稱:digital-display-garden-iteration-4-dorfner-v2,代碼行數:21,代碼來源:ExcelParser.java

示例5: getNextTriggerTimeReturnsTheNextDateTimeOfTheHourAndMinute

import org.joda.time.DateTime; //導入方法依賴的package包/類
@Test
public void getNextTriggerTimeReturnsTheNextDateTimeOfTheHourAndMinute() {
    DateTime now = DateTime.now();
    int hour = (now.getHourOfDay() + 1) % 24;
    int minute = (now.getMinuteOfHour() + 5) % 60;

    Alarm alarm = new Alarm(context, podcast, hour, minute);

    DateTime triggerTime = alarm.getNextTriggerTime();

    assertEquals(hour, triggerTime.getHourOfDay());
    assertEquals(minute, triggerTime.getMinuteOfHour());
    assertEquals(0, triggerTime.getSecondOfMinute());
    assertEquals(0, triggerTime.getMillisOfSecond());
    assertTrue(triggerTime.isAfter(now));
}
 
開發者ID:KevinLiddle,項目名稱:crockpod,代碼行數:17,代碼來源:AlarmTest.java

示例6: getNextTriggerTimeReturnsTheNextDateTimeOfTheHourAndMinuteWhenThe

import org.joda.time.DateTime; //導入方法依賴的package包/類
@Test
public void getNextTriggerTimeReturnsTheNextDateTimeOfTheHourAndMinuteWhenThe() {
    DateTime now = DateTime.now();
    DateTime before = new DateTime(now).minusHours(1).minusMinutes(5);

    Alarm alarm = new Alarm(context, podcast, before.getHourOfDay(), before.getMinuteOfHour());

    DateTime triggerTime = alarm.getNextTriggerTime();

    assertEquals(before.getHourOfDay(), triggerTime.getHourOfDay());
    assertEquals(before.getMinuteOfHour(), triggerTime.getMinuteOfHour());
    assertTrue(triggerTime.isAfter(now));
}
 
開發者ID:KevinLiddle,項目名稱:crockpod,代碼行數:14,代碼來源:AlarmTest.java

示例7: onCreateDialog

import org.joda.time.DateTime; //導入方法依賴的package包/類
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    DateTime currentDateTime = new DateTime();
    int currentHour = currentDateTime.getHourOfDay();
    int currentMinute = currentDateTime.getMinuteOfHour();
    final Bundle args = getArguments();

    MinTimePickerDialog timePickerDialog = new MinTimePickerDialog(getActivity(), R.style.MyPicker,
            (view, hourOfDay, minute) -> {
                DateTime dateTime = new DateTime(
                        args.getInt(ARGUMENT_PICKED_YEAR),
                        args.getInt(ARGUMENT_PICKED_MONTH) + 1,
                        args.getInt(ARGUMENT_PICKED_DAY), hourOfDay, minute);
                EventBus.getDefault().post(new ReminderSetEvent(dateTime.getMillis()));
            }, currentHour, currentMinute, DateFormat.is24HourFormat(getActivity()));
    if (args.getBoolean(ARGUMENT_IS_TODAY)) {
        timePickerDialog.setMin(currentHour, currentMinute);
    }

    return timePickerDialog;
}
 
開發者ID:Laaidback,項目名稱:A.scribe,代碼行數:23,代碼來源:TimePickerDialogFragment.java

示例8: getCurrentTimeCloseToPrevInterval

import org.joda.time.DateTime; //導入方法依賴的package包/類
@Override
public final long getCurrentTimeCloseToPrevInterval() {
    long keepMinute = System.currentTimeMillis() / interval * interval;
    DateTime dt = new DateTime(keepMinute);
    int min = dt.getMinuteOfHour();
    min = getPrevIntervalMinute(min);
    dt = dt.minuteOfHour().setCopy(min);
    return dt.getMillis();
}
 
開發者ID:zhaoxi1988,項目名稱:sjk,代碼行數:10,代碼來源:CDNCacheImpl.java

示例9: setCacheScanSoftIfHit

import org.joda.time.DateTime; //導入方法依賴的package包/類
@Override
public void setCacheScanSoftIfHit(HttpServletResponse resp) {
    DateTime now = new DateTime();

    long keepMinute = now.getMillis() / interval * interval;
    DateTime keepMinuteDateTime = new DateTime(keepMinute);
    int min = keepMinuteDateTime.getMinuteOfHour();
    min = getPrevIntervalMinute(min);
    DateTime lastModified = keepMinuteDateTime.minuteOfHour().setCopy(min);
    resp.setHeader("Last-Modified", toGMT(lastModified));
    DateTime expires = now.plusMinutes(expiresMinuteForScansoftIfHit);
    resp.setHeader("Expires", toGMT(expires));
    resp.setHeader("Cache-Control", maxAgeIfHit);
}
 
開發者ID:zhaoxi1988,項目名稱:sjk,代碼行數:15,代碼來源:CDNCacheImpl.java

示例10: parseDate

import org.joda.time.DateTime; //導入方法依賴的package包/類
public static long parseDate(String dateTime) {
    DateTimeFormatter formatter = DateTimeFormat.forPattern("MM/dd hh:mm aa");
    DateTime d = formatter.parseDateTime(dateTime);
    DateTime dt = new DateTime(Calendar.getInstance().get(Calendar.YEAR), d.getMonthOfYear(), d.getDayOfMonth(), d.getHourOfDay(), d.getMinuteOfHour(), Constants.DATE.VEGAS_TIME_ZONE);
    return dt.getMillis();
}
 
開發者ID:riteshakya037,項目名稱:Android-Scrapper,代碼行數:7,代碼來源:ParseUtils.java

示例11: getMinute

import org.joda.time.DateTime; //導入方法依賴的package包/類
/**
 * 獲取date對象分鍾數
 * @param date
 * @return
 */
public static int getMinute(Date date) {
	DateTime dt = new DateTime(date);
	return dt.getMinuteOfHour();
}
 
開發者ID:huang-up,項目名稱:mycat-src-1.6.1-RELEASE,代碼行數:10,代碼來源:DateUtil.java

示例12: getMinute

import org.joda.time.DateTime; //導入方法依賴的package包/類
/**
 * getMinute
 *
 * @param date
 * @return
 */
public static int getMinute(Date date) {
    DateTime dt = new DateTime(date);
    return dt.getMinuteOfHour();
}
 
開發者ID:actiontech,項目名稱:dble,代碼行數:11,代碼來源:DateUtil.java


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