如何在java中将long变量更改为时间戳?
您知道如何将 long 变量更改为 Timestamp 变量吗?我可以将其转换为字符串,但我需要将其转换为时间戳才能在数据库中使用它。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能类似于(假设 millis 是您的长变量,代表毫秒):
http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Timestamp.html
这个问题更适合stackoverflow,但我正在标记它。
Probably something like (assuming millis is your long variable, and represents milliseconds):
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.