1 public static void main(String[] args){
2         Date date = new Date();
3         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
4         format.format(date);
5         System.out.println(format.format(date));
6     }


这样,输出时间格式为: 2012-06-01 09:26:54

相关文章:

  • 2022-01-17
  • 2019-06-24
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-23
  • 2019-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案