Reputation: 147
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;
}
Upvotes: 0
Views: 125
Reputation: 66
You can use @Temporal(TemporalType.DATE)
to only store the date part.
Upvotes: 1