0
String dateFormat="Timestamp";
String timeVal ="2015-11-13 05:30:00.0";

return new SimpleDateFormat(dateFormat).format(new Date((((Timestamp) timeVal).getTime())));
SatyaTNV
  • 4,137
  • 3
  • 15
  • 31
bakesh
  • 27
  • 4

1 Answers1

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.

SimpleDateFormat doc

SatyaTNV
  • 4,137
  • 3
  • 15
  • 31