Pleezon
Pleezon
JCHJava Community | Help. Code. Learn.
Created by SubGplayz on 10/26/2024 in #java-help
Any java window I open does really weird stuff
23 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
that should at least make it parse correctly
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
@' .•` KIΛ.RΛR ’•. '
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
public class ReservationForm {
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
private LocalDateTime date;

public ReservationForm(LocalDateTime date) {
this.date = LocalDateTime.now();
}

public LocalDateTime getDate() {
return date;
}

public void setDate(LocalDateTime date) {
this.date = date;
}

}
public class ReservationForm {
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS")
private LocalDateTime date;

public ReservationForm(LocalDateTime date) {
this.date = LocalDateTime.now();
}

public LocalDateTime getDate() {
return date;
}

public void setDate(LocalDateTime date) {
this.date = date;
}

}
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
the correct format would be something along the lines of yyyy-MM-dd'T'HH:mm:ss.SSSSSS
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
I doubt your pattern would work considering "2023-11-29T11:20:17.719199" as possible input
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
Your ReservationForm specifies a datetime pattern in @DateTimeFormat decorator
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
(I sadly can't try it rn)
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
I have a feeling this won't work because the string looks sketchy in regards to the format pattern
21 replies
JCHJava Community | Help. Code. Learn.
Created by ' .•` KIΛ.RΛR ’•. ' on 11/29/2023 in #java-help
springframework.validation.BindException: Date
Have you tried parsing your string using
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = formatter.parse("2023-11-29T11:20:17.719199");
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = formatter.parse("2023-11-29T11:20:17.719199");
21 replies