Umgang mit mehreren Formaten in DateTimeFormatter

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Umgang mit mehreren Formaten in DateTimeFormatter

by Anonymous » 31 Aug 2025, 12:38

I am developing using Java 8 a function that must handle the conversion from String to LocalDateTime of the following dates:


[*]2019-06-20 12:18:07.207 +0000 UTC
[*]2019-06-20 12:18:07.20 +0000 UTC < /li>
2019-06-20 12: 18: 07.2 +0000 UTC < /li>
2019-06-20 12:18:07 +0000 UTC < /li>
< /ul>

Die Schläge werden aus einer externen Bibliothek erstellt. /> Befolgen Sie die Vorschläge, die in den optionalen Teilen von SO Antwort in SimpleDateFormat angegeben sind. Ich habe die folgenden Muster ausprobiert: < /p>

Code: Select all

yyyy-MM-dd HH:mm:ss[.S[S[S]]] Z z
yyyy-MM-dd HH:mm:ss[.S] Z z< /code> < /li>
< /ul>

funktioniert jedoch keiner von beiden.>

Top