/**
   * 得到时间为隔天的九点、并且跳过周末
   */

/** * 获得收益时间(获取当前天+1天,周末不算). qiulinhe,2015年10月29日09:51:34 *  * @param date *            任意日期 * @return the income date * @throws NullPointerException *             if null == date */public static Date getIncomeDate(Date date) throws NullPointerException {if (null == date) {throw new NullPointerException("the date is null or empty!");}// 对日期的操作,我们需要使用 Calendar 对象Calendar calendar = new GregorianCalendar();calendar.setTime(date);calendar.add(Calendar.MONTH, 0);// +1天calendar.add(Calendar.DAY_OF_MONTH, +1);calendar.set(Calendar.HOUR, 9);calendar.set(Calendar.MINUTE, 0);// 判断是星期几int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);Date incomeDate = calendar.getTime();if (dayOfWeek == 1 || dayOfWeek == 7) {// 递归return getIncomeDate(incomeDate);}return incomeDate;}

更多相关文章

  1. Python3原生编写月份计算工具
  2. 从零开始学android:Android事件处理—监听日期与时间的改变
  3. Android(安卓)Studio菜鸟开发————TimePicker DataPicker 日
  4. Android日期选择器对话框DatePickerDialog使用详解
  5. android timessquare日期控件
  6. android学习笔记21:日期时间控件
  7. android开发之获取系统时间的方法
  8. android 调用系统自带的设置时间日期对话框
  9. DatePickerDialog 自定义样式及使用全解

随机推荐

  1. 使用ListView实现网上订餐首页
  2. android之组件1
  3. Android程序窗体显示:requestWindowFeatur
  4. android 图片浏览 处理
  5. Android 中 CheckBox 的基本使用
  6. Android(安卓)studio 导入Module后报错记
  7. 另一个更简单的Android应用程序全屏的方
  8. android类
  9. Android 属性文件build.prop,获取属性以及
  10. android 抽屉的一些小问题