Timestamp获得数据库的时间戳

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaocxks/article/details/52701572

select convert(varchar(12),getdate(),20)

获得数据库中的时间

第三个参数代表时间输出的格式


Timestamp time=Timestamp.valueOf( String s );


Timestamp的valueOf是一个static方法,所以不用创建对象,可以直接调用方法

该方法将JDBC时间戳转义格式的String对象转换为Timestamp值

猜你喜欢

转载自blog.csdn.net/xiaocxks/article/details/52701572
今日推荐