I have questions about the steps to manipulate dates.
Are the steps below ok? Can I start my studies?
- I have the
Date
attribute and want to insert 2 days. - Convert
Date
toString
. - Convert
String
toCalendar
. - I make the code to manipulate the date obtained.
- Converting from
Calendar
toString
. - Converting from
String
toDate
. - Saved.
Why should I try to declare as Calendar
when saved from this error?
Unresolved compilation problem: Type mismatch: can not convert from
Code for more details:
// data em que o dinheiro foi entregue
@DateTimeFormat(pattern = "dd/MM/yyyy")
@Temporal(TemporalType.DATE)
private Date dataEmprestimo;
If I put private Calendar dataEmprestimo
, it gives the error mentioned above.