当前位置: 代码迷 >> 综合 >> 获取当前时间格式化存入Mysql数据库
  详细解决方案

获取当前时间格式化存入Mysql数据库

热度:11   发布时间:2023-10-12 23:00:21.0
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;public static Date getTime() throws ParseException {    Date date = new Date();//获得系统当前时间.SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );String nowTime = sdf.format(date);return sdf.parse( nowTime );
}
  相关解决方案