java得到年月日小时分秒 0引荐 Calendar cal=Calendar.getInstance(); cal.setTime(new Date()); int year=cal.get(Calendar.YEAR); int month=cal.get(Calendar.MONTH)+1; int date=cal.get(Calendar.DATE); int hour=cal.get(Calendar.HOUR); int minute=cal.get(Calendar.MINUTE); int second=cal.get(Calendar.SECOND); int milliSecond=cal.get(Calendar.MILLISECOND);