code is
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = format.parse("2024-03-01 09:20:46");
the date's value is Sun Dec 03 00:01:09 CST 2023 without any Exception.
I read some comment in jdk, it might show that '-' will treat to minus , is it real? And how to understand the read think in the method SimpleDateFormat.parse
use DateTimeFormatter
or
you can do this