So I have an
<input type=date" >
in my form, and the User model that has
@Column(name=birthday)
public Date birthday;
Date being imported from java.util.Data
This needs to be persisted to a MySQL database, which has the following format. MySQL field is of type Date
yyyy-mm-dd
I tried changing the format using of the column
@DateTimeFormat(pattern = "yy-MMMM-dd")
but it doesn't work, I'm assuming because of the input type format. How do I change this? I am using spring-boot.
CREATE TABLE user(user_id int(11) NOT NULL AUTO_INCREMENT,email varchar(255) NOT NULL,last_name varchar(255) NOT NULL,name varchar(255) NOT NULL,password varchar(255) NOT NULL,birthday Date NOT NULL,` PRIMARY KEY` (user_id))