String dateFormat="Timestamp";
String timeVal ="2015-11-13 05:30:00.0";
return new SimpleDateFormat(dateFormat).format(new Date((((Timestamp) timeVal).getTime())));
Asked
Active
Viewed 340 times
0
-
1What kind of date format do you think that is? – Jeroen Vannevel Oct 12 '15 at 13:31
1 Answers
2
Instead of
String dateFormat="Timestamp";
use
String dateFormat="yyyy-MM-dd HH:mm:ss";
If your date is like
String timeVal ="2015-11-13 05:30:00";
Here you must use date and time format of your date and time.

SatyaTNV
- 4,137
- 3
- 15
- 31
-
-
@bakesh http://stackoverflow.com/questions/18915075/java-convert-string-to-timestamp – SatyaTNV Oct 12 '15 at 13:47