System.out.println("Hello World!");
SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss");//设置时间格式
Date currentTime = new Date();//获取当前时间  
String date=format.format(currentTime);//对当前时间进行格式化
currentTime=format.parse(date);//自定义格式的时间

 

相关文章:

  • 2021-11-12
  • 2021-12-29
  • 2021-11-07
  • 2022-02-07
  • 2021-10-23
  • 2022-12-23
  • 2022-02-17
猜你喜欢
  • 2021-12-15
  • 2021-11-23
  • 2022-12-23
  • 2021-07-15
  • 2021-05-20
相关资源
相似解决方案