有时需要记录一下数据生成时间的时间戳,精确到秒,这里记录一下java存储时间戳字符串的几种方式

1、DateFormat

  private static final SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

  String dateStamp=sdf.format(new java.util.Date());

相关文章:

  • 2021-09-12
  • 2021-11-03
  • 2021-08-22
  • 2021-11-27
  • 2021-08-24
  • 2022-12-23
  • 2021-12-16
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2021-08-10
  • 2021-05-31
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
相关资源
相似解决方案