The SimpleDateFormat class is used to format instances of the Date class as strings using a pattern.

The SimpleDateFormat class is now a legacy class; the DateTimeFormatter is a more up to date alternative as part of the new java.time API.

Enter a Java SimpleDateFormat pattern to see immediately how the current date will be formatted.

Format Pattern

Locale

Empty input

Java version: 1.8.0_265

Common Issues