This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
您不应使用旧的
日期
和SimpleDateFormat
类。而是使用localdateTime
,ZonedDateTime
和Datementiment Formatter
You shouldn't use the old
Date
andSimpleDateFormat
classes. Instead, useLocalDateTime
,ZonedDateTime
, andDateTimeFormatter
您指定错误的SimpleDateFormat。将其更改
为
SimpleDateFormat df = new SimperedateFormat(“ DD-MM-YYYY HH:MM:SS”);
>You are specifying wrong SimpleDateFormat. change this
to
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
正如Alexey R提到的那样,您的模式需要进行一些更正:
As Alexey R mentioned your pattern need some correction: