Im having a little trouble converting a sql timestamp to string, their outputs are different.
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
private Date auctionStart;
public void setTime(){
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String aucStartString = f.format(auctionStart);
}
My auctionStart date prints: 04-Apr-2017 17:14:10 When i convert it to string it prints: 2017-04-04 05:14:10
It looks like the hours are converting to 12 hour format, any ideas how to correct it?