select convert(varchar(12),getdate(),20)
获得数据库中的时间
第三个参数代表时间输出的格式
Timestamp time=Timestamp.valueOf( String s );
Timestamp的valueOf是一个static方法,所以不用创建对象,可以直接调用方法
该方法将JDBC时间戳转义格式的String对象转换为Timestamp值
select convert(varchar(12),getdate(),20)
获得数据库中的时间
第三个参数代表时间输出的格式
Timestamp time=Timestamp.valueOf( String s );
Timestamp的valueOf是一个static方法,所以不用创建对象,可以直接调用方法
该方法将JDBC时间戳转义格式的String对象转换为Timestamp值