Home » DateFormat

Tag Archives: DateFormat

Java String to Date Example

Java gives us the capability to convert String to Date. This can be done through DateFormat and SimpleDateFormat classes, where the last class is a subclass of the first one. It is worth to mention that DateFormat is not thread-safe, so it is recommended to create different instances for each thread. In this example we will show you how to ...

Read More »

Java SimpleDateFormat and DateFormat Example

In this example we will show how to use java.text.SimpleDateFormat class so as to format date into text or parse text into date. SimpleDateFormat extends the java.text.DateFormat class which is an abstract class for date/time formatting subclasses and provides many class methods for obtaining default date/time formatters based on any given locale. We will see the usage of the class ...

Read More »