2013年11月28日
摘要: 现有两个办法1:Date as = new Date(new Date().getTime()-24*60*60*1000);SimpleDateFormat matter1 = new SimpleDateFormat("yyyy-MM-dd");String time = matter1.format(as);System.out.println(time); 取出数字型的时间 再减去24*60*60*1000,就得到昨天的时间了;这个有点过时了!2:Calendar cal = Calendar.getInstance();cal.add(Calendar.DATE, 阅读全文
posted @ 2013-11-28 11:15 little fat 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 时间大小由小到大排列,从秒开始,顺序为 秒,分,时,天,月,年 *为任意 ?为无限制。 具体如下: "0/10 * * * * ?" 每10秒触发 "0 0 12 * * ?" 每天中午12点触发 "0 15 10 ? * *" 每天上午10:15触发 "0 15 10 * * ?" 每天上午10:15触发 "0 15 10 * * ? *" 每天上午10:15触发 "0 15 10 * * ? 2005" 2005年的每天上午10:15触发 "0 * 14 * * 阅读全文
posted @ 2013-11-28 09:31 little fat 阅读(451) 评论(0) 推荐(0) 编辑