How to change a long variable to a Timestamp in Java?

前端 未结 3 938
时光说笑
时光说笑 2021-01-17 06:29

How do I change a long variable to a Timestamp variable? I can convert it to a String but I need to convert it to Timestamp in order to use it in a database.

3条回答
  •  春和景丽
    2021-01-17 07:07

    Use Timestamp. it has a constructor that receives long as the only parameter.

提交回复
热议问题