GregorianCalendar格力高日历


        /* * 复杂的时间计算 */
        Calendar cal = new GregorianCalendar();
        Date date = cal.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        System.out.println("现在的时间是>>> "+sdf.format(date));

        cal.add(Calendar.MONTH, 2);
        cal.add(Calendar.DATE, 5);
        date = cal.getTime();
        System.out.println("修改后的时间是>>> "+sdf.format(date));

        /* * 简单的时间计算 */
        long now = System.currentTimeMillis();
        long toDate = now+1000L*60*60*24*5;
        System.out.println(sdf.format(toDate)); 

你可能感兴趣的:(日历,格力高日历)