Issue
I am using an annotation @CreationTimestamp to write a date when a file is uploaded. How can I remove the minutes to leave only the year, month and day?
@Data
@Entity
@Table(name = "exchange_rates")
public class ExchangeRate {
///
@CreationTimestamp
@Column(name = "downloaddate")
private Date downloaddate;
}
Solution
You can use @Temporal(TemporalType.DATE)
to only store the date part.
Answered By - n-n-nebbl
Answer Checked By - Dawn Plyler (JavaFixing Volunteer)