SimpleDateFormat显示格式如2017-05-20 15:00:10,怎么显示为24小时的格式,而不是2017-05-20 3:00:10


SimpleDateFormat显示格式如2017-05-20 15:00:10,怎么显示为24小时的格式,而不是2017-05-20 3:00:10

亲测:

package test2;


import java.text.SimpleDateFormat;
import java.util.Date;


public class SimpleDateFormatTest {


/**
 * @param args
 */
public static void main(String[] args) {
// TODO Auto-generated method stub
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowDate = sdf.format(new Date());
System.out.println(nowDate);
}


}

SimpleDateFormat显示格式如2017-05-20 15:00:10,怎么显示为24小时的格式,而不是2017-05-20 3:00:10

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案