public class DateTime
{
public DateTime()
{
}

/**
* 取年日期时间
*
@return String 返回 yyyy-MM-dd HH:mm:ss
*/
public static String getdate() {
SimpleDateFormat formatter_f
= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date currentTime_f
= new Date(); //得到当前系统时间
String new_date_f = formatter_f.format(currentTime_f); //将日期时间格式化
return new_date_f;
}

public static void main(String[] args)
{
DateTime a
= new DateTime();
String s
= a.getdate();
System.out.println(getdate());
}
}

相关文章:

  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-06-22
  • 2021-09-26
  • 2022-01-21
相关资源
相似解决方案