我试图以特定格式获取当前日期,但月份不是分钟
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class CurrentDate {
public static String currentDate() {
String timeStamp = new SimpleDateFormat("mm/dd/yyyy").format(Calendar.getInstance().getTime());
return timeStamp;
}
public static void main (String [] args) {
System.out.println(currentDate());
}
}
为什么这段代码给出了分钟......我试过了...... ???