への変換にこの問題がありjava.sql.Timestamp.toString
ますjava.sql.Timestamp
。以下element = "2012-08-01 00:00:00.0"
のコードを指定して使用するParseException
とelement
、Unparseable date
.
import java.sql.Timestamp
import java.text.SimpleDateFormat
Timestamp string_timestamp(String element) {
if(!date)
return null
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy")
// error lies here! //
Date parsedDate = dateFormat.parse(date)
return new Timestamp(parsedDate.getTime())
}
java.sql.Timestamp.toString()
に戻す方法はありjava.sql.Timestamp
ますか?