开发者

How to change long variable to Timestamp in java?

Do you know how to change a long variable to Timestamp variable ? I can convert it开发者_高级运维 to a String but I need to convert it to Timestamp in order to use it in the database.


Probably something like (assuming millis is your long variable, and represents milliseconds):

Timestamp ts = new Timestamp(millis)

http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Timestamp.html

This question is better suited for stackoverflow though, I'm flagging it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜