//导入
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;     
  

Date dt
=new Date();//如果不需要格式,可直接用dt,dt就是当前系统时间
DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//设置显示格式
String nowTime="";
nowTime
= df.format(dt);//用DateFormat的format()方法在dt中获取并以yyyy/MM/dd HH:mm:ss格式显示

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2021-10-01
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2021-08-02
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案