Java:将long转换为Timestamp
我知道,如何使用getTime()
方法将Timestamp
转换为long。
有没有将long
转换为TimeStamp
?
构造函数正在这样做:
Timestamp(long time)
请参阅: Timestamp.Timestamp(long)
:
new Timestamp(someLong)
是的,有一个Timestamp的构造函数,它需要一个long作为参数。 http://docs.oracle.com/javase/6/docs/api/java/sql/Timestamp.html#Timestamp(long)