I am using System.currentTimeMillis() and adding the value of a day/week/month based on user input. How can I convert this to java.sql.Timestamp so I can save it in mysql? Thanks.
Use constructor.
new Timestamp(System.currentTimeMillis())
http://docs.oracle.com/javase/7/docs/api/java/sql/Timestamp.html#Timestamp(long)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With