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?
The constructor is doing that:
Timestamp(long time)
See: Timestamp.Timestamp(long):
new Timestamp(someLong)
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)
来源:https://stackoverflow.com/questions/10590324/java-convert-long-to-timestamp