Umgang mit mehreren Formaten in DateTimeFormatterJava

Java-Forum
Anonymous
 Umgang mit mehreren Formaten in DateTimeFormatter

Post by Anonymous »

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.>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post