use*_*539 5 java mysql timestamp
我正在使用System.currentTimeMillis()并根据用户输入添加日/周/月的值.我怎样才能将其转换为java.sql.Timestamp所以我可以将它保存在mysql中?谢谢.
Nai*_*gun 12
使用构造函数.
new Timestamp(System.currentTimeMillis())
Run Code Online (Sandbox Code Playgroud)
http://docs.oracle.com/javase/7/docs/api/java/sql/Timestamp.html#Timestamp(long)