Java : convert long to Timestamp

前端 未结 4 1622
面向向阳花
面向向阳花 2020-12-31 00:01

I know, how to convert a Timestamp to a long, with the getTime() method.

Is there a method that convert a long to a TimeStamp?

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 00:13

    Yes, there's a constructor for Timestamp that takes a long as a parameter. http://docs.oracle.com/javase/6/docs/api/java/sql/Timestamp.html#Timestamp(long)

提交回复
热议问题