Date的getSeconds()已经过时了。不建议用。所以用了下面方法

 

Calendar c = Calendar.getInstance();

 

while(true) {
            c.add(Calendar.SECOND, 1);
            SimpleDateFormat s = new SimpleDateFormat("ss");
            System.out.println(s.format(c.getTime()));
          
        }

相关文章:

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