用SimpleDateFormat来转换 String转Date

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse("1999-09-09 12:09:12");

Date 转 String
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String strDate = sdf.format(d);

相关文章:

  • 2022-03-05
  • 2021-10-02
  • 2022-12-23
  • 2021-10-04
  • 2021-12-30
  • 2021-11-05
  • 2022-12-23
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2021-09-15
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案