package com.test;

import java.text.SimpleDateFormat;
import java.util.Date;

public class test {
public static void main(String[] args) { 
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
System.out.println(df.format(new Date()));// new Date()为获取当前系统时间
}

java获取系统当前时间

相关文章:

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