Before JDK 8, the typical solution to this problem relies on the main extension of the abstract DateFormat class, named SimpleDateFormat (this is not a thread-safe class). In the code that is bundled to this book, there are several examples of how to use this class.