反回两个时间相差多少小时
2014-04-19 08:15
260 查看
反回两个时间相差多少小时
*
* @param beginDate
* @param endDate
* @return
*/
public static long getEndDateToBeginDateMinute(Timestamp beginDate, Timestamp endDate)
{
long l = (endDate.getTime() - beginDate.getTime())/1000;
long hour=l/(60 * 60);
return hour;
}
CartonPlanControlRoomHelp
timeGroupList = new ArrayList();
// 获取已占用时间段
entityViewInfo.getFilter().getFilterItems().add(new FilterItemInfo("workCell.id", cutCraft.getWorkCell().getString("id"), CompareType.EQUALS));
XXCollection cutCols = XXFactory.getLocalInstance(ctx).getXXCollection(entityViewInfo);
for (int x = 0; x < cutCols.size(); x++)
{
timeGroupList.add(new TimeGroup(cutCols.get(x).getPlanBegin(), cutCols.get(x).getPlanFinish()));
}
// 获取停机计划
stopEVInfo.getFilter().getFilterItems().add(
new FilterItemInfo("workCellId", cutCraft.getWorkCell().getString("id"), CompareType.EQUALS));
stopLogsCols = StopLogsFactory.getLocalInstance(ctx).getStopLogsCollection(stopEVInfo);
for (int x = 0; x < stopLogsCols.size(); x++)
{
timeGroupList.add(new TimeGroup(stopLogsCols.get(x).getStartTime(), stopLogsCols.get(x).getEndTime()));
}
after 晚
//xx时间小于'当天的23:59:59'的;
Calendar enArriveDate = Calendar.getInstance();
enArriveDate.set(Calendar.HOUR_OF_DAY,19);
enArriveDate.set(Calendar.MINUTE,0);
enArriveDate.set(Calendar.SECOND,0);
Date starttime = enArriveDate.getTime();
enArriveDate.set(Calendar.HOUR_OF_DAY,23);
enArriveDate.set(Calendar.MINUTE,59);
enArriveDate.set(Calendar.SECOND,59);
if((new Date()).after(starttime) && (new Date()).before(enArriveDate.getTime())){
if (prepAssemble.isSelected())
{
IsprepAssemble = true;
}
}
*
* @param beginDate
* @param endDate
* @return
*/
public static long getEndDateToBeginDateMinute(Timestamp beginDate, Timestamp endDate)
{
long l = (endDate.getTime() - beginDate.getTime())/1000;
long hour=l/(60 * 60);
return hour;
}
CartonPlanControlRoomHelp
timeGroupList = new ArrayList();
// 获取已占用时间段
entityViewInfo.getFilter().getFilterItems().add(new FilterItemInfo("workCell.id", cutCraft.getWorkCell().getString("id"), CompareType.EQUALS));
XXCollection cutCols = XXFactory.getLocalInstance(ctx).getXXCollection(entityViewInfo);
for (int x = 0; x < cutCols.size(); x++)
{
timeGroupList.add(new TimeGroup(cutCols.get(x).getPlanBegin(), cutCols.get(x).getPlanFinish()));
}
// 获取停机计划
stopEVInfo.getFilter().getFilterItems().add(
new FilterItemInfo("workCellId", cutCraft.getWorkCell().getString("id"), CompareType.EQUALS));
stopLogsCols = StopLogsFactory.getLocalInstance(ctx).getStopLogsCollection(stopEVInfo);
for (int x = 0; x < stopLogsCols.size(); x++)
{
timeGroupList.add(new TimeGroup(stopLogsCols.get(x).getStartTime(), stopLogsCols.get(x).getEndTime()));
}
after 晚
//xx时间小于'当天的23:59:59'的;
Calendar enArriveDate = Calendar.getInstance();
enArriveDate.set(Calendar.HOUR_OF_DAY,19);
enArriveDate.set(Calendar.MINUTE,0);
enArriveDate.set(Calendar.SECOND,0);
Date starttime = enArriveDate.getTime();
enArriveDate.set(Calendar.HOUR_OF_DAY,23);
enArriveDate.set(Calendar.MINUTE,59);
enArriveDate.set(Calendar.SECOND,59);
if((new Date()).after(starttime) && (new Date()).before(enArriveDate.getTime())){
if (prepAssemble.isSelected())
{
IsprepAssemble = true;
}
}
相关文章推荐
- 计算格式为YYYY-MM-DD HH:ii:ss的两个时间,相差多少年、多少月、多少日、多少小时、多少分钟、多少秒?
- 两个时间相差距离多少小时 (精确到秒)
- java语言编程实现两个时间相差多少天、多少小时、多少分、多少秒
- JS 获取两个时间相差多少个小时
- ios 两个时间之间的比较,相差多少天多少小时多少分多少秒
- GoLang 获取两个时间相差多少小时
- 计算两个时间相差多少年月日的sql算法
- java计算两个日期相差多少天小时分钟等
- java计算两个日期间相差多少天多少小时多少分多少秒
- C#有关时间处理的一些方法,两个日期间相差的天、小时、分钟、月数等
- 显示两个时间相差几天几小时几分几秒
- JAVA 时间差距,两个时间相差多少天,时,分,秒
- php计算两个时间相差的天数、小时数、分钟数、秒数
- 两个日期相差多少时间, 精确到秒
- JAVA 时间差距,两个时间相差多少天,时,分,秒
- Java比较两个时间相差多少天,多少个月,多少年
- Java计算两个日期时间相差几天,几小时,几分钟等
- 计算两个时间 相差多少时分秒
- 使用joda-time工具类 计算时间相差多少 天,小时,分钟,秒
- oracle 计算两个时间之间的月份差,相差几个星期,相差多少天