3 ms·
What do you propose instead? Java provides a set of predefined date formatters in the standard library [1] - like 'ISO_LOCAL_DATE_TIME' and 'RFC_1123_DATE_TIME
by michaelt 9y ago
What do you propose instead?
Java provides a set of predefined date formatters in the standard library [1] - like 'ISO_LOCAL_DATE_TIME' and 'RFC_1123_DATE_TIME'
Of course, they don't cover every possibility - if you want milliseconds, you've got to roll your own :)
[1] https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html https://docs.oracle.com/javase/8/docs/api/java/time/format/D...
- hyperman1 9y agoVery true. Another example is the jquey UI date picker which stores nice defaults in the i18n files. I would classify these as storing the knowledge in the ecosystem.
- bobbyi_settv 9y agotoString on a java.time.instant gives it in ISO format without even needing to bother with formatter objects.