Class Calendar能满足你的需求

解决方案 »

  1.   

    import java.text.SimpleDateFormat;
    import java.text.ParseException;
    import java.util.Date;
    import java.util.Calendar;
    public class TimeTest {
        private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        private static String timeOne = "2007-08-29";
        private static String timeTwo = "2007-09-04";    public void run() throws ParseException {
            Date nowDate = new Date();
            Calendar cal=Calendar.getInstance();
            cal.setTime(nowDate);
            if (cal.before(sdf.parse(timeOne)) || cal.after(sdf.parse(timeTwo))) {
                System.out.println("1");
                return;        }
            //todo:具体的需要执行的代码
            System.out.println("2");
        }
        public static void main(String args[]) throws Exception
        {
            TimeTest test=new TimeTest();
            test.run();
        }
    }
      

  2.   

    Calendar 可以满足你的要求,
    楼上已经写的比较清晰了,呵呵.可以jt了吧
      

  3.   

    招聘全职软件开发人员,工作地点:沈阳1、二年以上实际工作经验
    2、Servlet、Jsp 等技术的B/S开发工作经验。
    3、熟悉SQL Server/Oracle大型关系数据库至少一种。
    4、团队合作能力强,能够独立并及时完成分配的工作任务,计算机及相关专业,大学本科以上学历。
    5、同时具有Delphi实际项目开发经验更好。有Java实际项目开发经验者优先考虑
    6、待遇面议,请在简历中写清楚
    注:上述要求中的实际项目指正式工作中参与的项目,IT培训班、毕业设计和个人练习等做过的项目除外。有意者请投简历至:[email protected]