You can make use of the SimpleDateFormat
Example:
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date date = new Date();
date.setTime(rec.getDateTrami().getTime());
System.out.println(format.format(date));
Documentation:
SimpleDateFormat,
DateFormat