final String time = "15:30:00"; //每天15::30分执行 final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd " + time); Date startTime; try { startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(sdf.format(new Date())); timer = new Timer(); //24小时执行1次 timer.schedule(new MemberTask(), startTime, 24 * 60 * 60 * 1000); } catch (final ParseException e) { e.getStackTrace(); }