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


Java Date.getMinutes方法代码示例

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


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

示例1: setTime

import java.util.Date; //导入方法依赖的package包/类
public void setTime(long time) {
    Date d = new Date(time);
    long dtime;
    int year = d.getYear() + 1900;
    if (year < 1980) {
        dtime = (1 << 21) | (1 << 16);
    }
    else {
        dtime = (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
        d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
        d.getSeconds() >> 1;
    }

    modificationDate = (short)(dtime >> 16);
    modificationTime = (short)(dtime & 0xFFFF);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:17,代码来源:ZioEntry.java

示例2: isEqual

import java.util.Date; //导入方法依赖的package包/类
/**
 * @todo have to solve the milli second problem that which is there.!!
 * @param convDate
 * @param expectedDate
 * @return
 */
@SuppressWarnings("deprecation")
protected static boolean isEqual(Date convDate, Date expectedDate)
{
  GregorianCalendar convGcal = new GregorianCalendar();
  convGcal.setTime(convDate);

  GregorianCalendar expGcal = new GregorianCalendar();
  expGcal.setTime(expectedDate);

  // -= Simon Lessard =-
  // FIXME: Switch to Calendar methods
  return
    (convDate.getSeconds() == expectedDate.getSeconds()) &&
    (convDate.getYear()    == expectedDate.getYear())    &&
    (convDate.getMonth()   == expectedDate.getMonth())   &&
    (convDate.getDate()    == expectedDate.getDate())    &&
    (convDate.getHours()   == expectedDate.getHours())   &&
    (convDate.getMinutes() == expectedDate.getMinutes()) ;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:26,代码来源:DateTimeConverterTestCase.java

示例3: isBetweenTime

import java.util.Date; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public static boolean isBetweenTime(int startHour, int startMin, int endHour, int endMin)
{
    Date cD = getCurrentDate();
    int hour = cD.getHours();
    int min = cD.getMinutes();
    
    long cTime = hour * 60 + min;
    
    long startTime = startHour * 60 + startMin;
    long endTime = endHour * 60 + endMin;
    if (cTime > startTime && cTime < endTime)
    {
        return true;
    }
    return false;
}
 
开发者ID:zhuyu1022,项目名称:amap,代码行数:18,代码来源:MIP_DateUtil.java

示例4: setTime

import java.util.Date; //导入方法依赖的package包/类
private void setTime() {
  Date now = new Date();
  int hours = now.getHours();
  hours = (hours>12)?hours-12:hours;
  int minutes  = now.getMinutes();
  int h1 = hours/10;
  int h2 = hours - h1*10;
  int m1 = minutes/10;
  int m2 = minutes -  m1*10;
  
  Log.d(TAG, String.format("%d:%d -> %d %d: %d %d",hours, minutes, h1, h2, m1, m2));
  
  h1View.setImageResource( numToRes(h1) );
  h2View.setImageResource( numToRes(h2) );
  m1View.setImageResource( numToRes(m1) );
  m2View.setImageResource( numToRes(m2) );
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:18,代码来源:ClockActivity.java

示例5: GetChineseHour

import java.util.Date; //导入方法依赖的package包/类
public String GetChineseHour(Date dt, Date _date) {

        int _hour, offset, i;
        int _minute = 0;
        int indexGan;
        String ganHour, zhiHour;
        String tmpGan;

        //计算时辰的地支
        _hour = dt.getHours();   //获得当前时间小时
        _minute = dt.getMinutes();  //获得当前时间分钟

        if (_minute != 0) _hour += 1;
        offset = _hour / 2;
        if (offset >= 12) offset = 0;
        //zhiHour = zhiStr[offset].ToString();

        //计算天干
        int ts = Utils.daysBetween(_date, Consts.GanZhiStartDay);
        i = ts % 60;

        indexGan = ((i % 10 + 1) * 2 - 1) % 10 - 1; //ganStr[i % 10] 为日的天干,(n*2-1) %10得出地支对应,n从1开始
        tmpGan = Consts.ganStr.substring(indexGan) + Consts.ganStr.substring(0, indexGan + 2);//凑齐12位
        //ganHour = ganStr[((i % 10 + 1) * 2 - 1) % 10 - 1].ToString();

        return tmpGan.toCharArray()[offset] + "" + Consts.zhiStr.toCharArray()[offset];

    }
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:29,代码来源:CalcLunar.java

示例6: feature

import java.util.Date; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public double[] feature(Date date) {
    double[] x = new double[types.length];
    for (int i = 0; i < types.length; i++)
    switch (types[i]) {
        case YEAR:
            x[i] = 1900 + date.getYear();
            break;
        case MONTH:
            x[i] = date.getMonth();
            break;
        case DAY_OF_MONTH:
            x[i] = date.getDate();
            break;
        case DAY_OF_WEEK:
            x[i] = date.getDay();
            break;
        case HOURS:
            x[i] = date.getHours();
            break;
        case MINUTES:
            x[i] = date.getMinutes();
            break;
        case SECONDS:
            x[i] = date.getSeconds();
            break;
        default:
            throw new IllegalStateException("Unknown date feature type: " + types[i]);
    }
    return x;
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:33,代码来源:DateFeature.java

示例7: javaToDosTime

import java.util.Date; //导入方法依赖的package包/类
public static long javaToDosTime(long time) {
    Date d = new Date(time);
    int year = d.getYear() + 1900;
    if (year < 1980) {
        return (1 << 21) | (1 << 16);
    }
    return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
           d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
           d.getSeconds() >> 1;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ZipUtils.java

示例8: javaToDosTime

import java.util.Date; //导入方法依赖的package包/类
/**
 * Converts Java time to DOS time.
 */
@SuppressWarnings("deprecation") // Use of date methods
public static long javaToDosTime(long time) {
    Date d = new Date(time);
    int year = d.getYear() + 1900;
    if (year < 1980) {
        return (1 << 21) | (1 << 16);
    }
    return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
           d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
           d.getSeconds() >> 1;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:ZipUtils.java

示例9: javaToDosTime

import java.util.Date; //导入方法依赖的package包/类
/**
 * Converts Java time to DOS time.
 */
@SuppressWarnings("deprecation") // Use of date methods
private static long javaToDosTime(long time) {
    Date d = new Date(time);
    int year = d.getYear() + 1900;
    if (year < 1980) {
        return ZipEntry.DOSTIME_BEFORE_1980;
    }
    return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
           d.getDate() << 16 | d.getHours() << 11 | d.getMinutes() << 5 |
           d.getSeconds() >> 1;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:ZipUtils.java

示例10: getTimeState

import java.util.Date; //导入方法依赖的package包/类
public static boolean getTimeState(long time) {
    boolean output;

    Date last = new Date(time);
    Date current = new Date(System.currentTimeMillis());

    output = last.getYear() < current.getYear() ||
            last.getMonth() < current.getMonth() ||
            last.getDay() < current.getDay() ||
            last.getHours() < current.getHours() ||
            last.getMinutes() < current.getMinutes();

    return output;
}
 
开发者ID:pedromassango,项目名称:Programmers,代码行数:15,代码来源:Util.java

示例11: initSimulatorName

import java.util.Date; //导入方法依赖的package包/类
private void initSimulatorName(){
	Date d = new Date();
	ParameterizedPaySim.simulatorName = "PS_" + (d.getYear() + 1900) + (d.getMonth() + 1)  + d.getDate() + d.getHours() + d.getMinutes()
			+ d.getSeconds() + "_" + this.seed;
	//System.out.println(simulatorName + "\n");
	File f = new File(System.getProperty("user.dir")  +"//outputs//" + ParameterizedPaySim.simulatorName);
	f.mkdir();
}
 
开发者ID:EdgarLopezPhD,项目名称:PaySim,代码行数:9,代码来源:ParameterizedPaySim.java

示例12:

import java.util.Date; //导入方法依赖的package包/类
public static Integer 分钟(Date $时间) {
		return $时间.getMinutes();
}
 
开发者ID:MikaGuraN,项目名称:HL4A,代码行数:4,代码来源:时间工具.java

示例13: timeStr

import java.util.Date; //导入方法依赖的package包/类
private String timeStr(long time) {
    Date d = new Date(time);
    return d.getHours()+":"+d.getMinutes();
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:5,代码来源:TestScheduleHelperAction.java

示例14: genSliceKey

import java.util.Date; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private String genSliceKey(Slice slice) {

    Date d = new Date(slice.getTime());
    return CACHE_PREFIX + slice.getKey() + "_" + d.getMinutes();
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:7,代码来源:RuntimeNotifySliceMgr.java

示例15: genJudgedKey

import java.util.Date; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private String genJudgedKey(Slice slice) {

    Date d = new Date(slice.getTime());
    return RNJUDGE_PREFIX + slice.getKey() + "_" + d.getMinutes();
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:7,代码来源:JudgeNotifyTask.java


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