当前位置: 首页>>代码示例>>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;未经允许,请勿转载。