Remove minutes from @CreationTimestamp annotation

Viewed 31

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;
}
1 Answers

You can use @Temporal(TemporalType.DATE) to only store the date part.

Related