Category: Date and Time

java tutorials

Converting a String into a Date in Java

This tutorial shows how to convert a java.lang.String into a java.util.Date. We can convert a String into a Date using the parse() method of the DateFormat and SimpleDateFormat classes. // from java.lang.String into java.util.Date String...
java tutorials

Getting Current Date and Time in Java

This tutorial shows how to get the current date and time in Java. The standard Java classes we can use are java.util.Date, java.util.Calendar and the new java 8 java.time.LocalDateTime and java.time.ZonedDateTime. You could also use...
java tutorials

How to parse a date in Java

In this tutorial we will show you how to parse a date in Java. To parse a date the JDK provides a SimpleDateFormat class. You can either define your own custom date format strings or...
java tutorials

How to format Date in Java

In this tutorial we will show you how to format date in Java. To format a date the JDK provides a SimpleDateFormat class. You can either define your own custom date format strings or use...