Date格式的时间,后面有个.0的处理方式

xiaoxiao2021-02-27  166

当从数据库查出来的时间,格式为Date并且多了一个.0,比如   2017-05-05 00:00:00.0   这时候可以提使用以下方法

java.sql.Timestamp date = (java.sql.Timestamp)item.getRtime(); String trayInDateStr = date.toLocaleString();

转载请注明原文地址: https://www.6miu.com/read-16622.html

最新回复(0)