Java Timestamp - How can I create a Timestamp with the date 23/09/2007?

后端 未结 8 1826

How can I create a Timestamp with the date 23/09/2007?

8条回答
  •  青春惊慌失措
    2020-11-28 21:29

    According to the API the constructor which would accept year, month, and so on is deprecated. Instead you should use the Constructor which accepts a long. You could use a Calendar implementation to construct the date you want and access the time-representation as a long, for example with the getTimeInMillis method.

提交回复
热议问题