date 输出格式

一、Date的12小时制和24小时制java

  1. public static final DateFormat formatWithTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");  spa

  2. java.util.Date newStartTime = formatWithTime.parse("2016-03-21 14:41:00");  orm

  3. //把字符串转变成Date,发现老是转化成12小时制的,  字符串

  4. //后来查资料发现,hh表示的是12小时制,HH才是24小时制  get

  5. String startTimeStr = formatWithTime.format(scheduler.getStartTime());  it


  1. public static final DateFormat formatWithTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");form

相关文章
相关标签/搜索