I'm using primefaces and I have a datePicker <p:datePicker id="birthDate" value="#{accountBean.accountModel.birthDate}" pattern="yyyy-MM-dd"/>
and I have an model like this :
public class AccountModel implements Serializable{
public String accountId;
public String name;
public String address;
public Date birthDate;
public boolean allowNegativeBalance;
public BigDecimal balance;
// Getter Setter
}
The problem is when I try to System.out.println(accountModel.getBirthDate());
the result is Tue Feb 23 00:00:00 ICT 1997
(Date) . How to make the Tue Feb 23 00:00:00 ICT 1997
(Date) to 1997-02-23
(Date) when I access the getter of my model? Thank you.