new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date());

解决方案 »

  1.   

    new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date());
      

  2.   

    import java.until.*;Calendar todaysDate = new GregorianCalendar();
    year = todaysDate.get(Calendar.YEAR);
    month = todaysDate.get(Calendar.MONTH) + 1;
    day = todaysDate.get(Calendar.DAY_OF_MONTH);
    hourOfDay = todaysDate.get(Calendar.HOUR_OF_DAY);  // 24小时制
    hour = todaysDate.get(Calendar.HOUR);         // 12小时制
    minute = todaysDate.get(Calendar.MINUTE);
    second = todaysDate.get(Calendar.SECOND);
      

  3.   

    Calendar cal=Calendar.getInstance();
    cal.setTimeInMillis(new Date(System.currentTimeMillis())-30*24*60*60);cal.setTimeInMillis(new Date(System.currentTimeMillis()))是获取系统时间。看看,这是 Current Time!