SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");//时间格式化
String newDate = sdf.format(new Date());
上面是24小时制的,
12小时制的话使用,就把HH该为hh就好啦
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");//时间格式化
String newDate = sdf.format(new Date());
上面是24小时制的,
12小时制的话使用,就把HH该为hh就好啦
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss");