posts - 27,comments - 2,trackbacks - 0
           
                
                /**
          * 得到幾天前的時間
          * @param d
          * @param day
          * @return
          */
          public static Date getDateOfBefore(Date d, int day) {
          Calendar now = Calendar.getInstance();
          now.setTime(d);
          now.set(Calendar.DATE, now.get(Calendar.DATE) - day);
          return now.getTime();
          }
                /**
          * 得到幾天后的時間
          * @param d
          * @param day
          * @return
          */
          public static Date getDateOfAfter(Date d, int day) {
          Calendar now = Calendar.getInstance();
          now.setTime(d);
          now.set(Calendar.DATE, now.get(Calendar.DATE) + day);
          return now.getTime();
          }
          posted on 2013-06-28 17:55 魏文甫 閱讀(287) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 黑龙江省| 石林| 望江县| 义马市| 汉源县| 历史| 肥城市| 同心县| 和林格尔县| 沙湾县| 南和县| 孝感市| 莎车县| 和龙市| 当涂县| 山东省| 扬中市| 望谟县| 沅江市| 星子县| 晋中市| 琼中| 巴中市| 安塞县| 光山县| 杨浦区| 自治县| 奉贤区| 洱源县| 满洲里市| 新邵县| 宁夏| 青冈县| 张家界市| 和硕县| 曲周县| 崇仁县| 郁南县| 博野县| 镇宁| 托里县|