SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",
Locale.getDefault());
String date = sDateFormat.format(new java.util.Date());
上述代码输出24小时制。将HH写成hh就是12小时制了。
SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",
Locale.getDefault());
String date = sDateFormat.format(new java.util.Date());