Java 8 – Convert LocalDate to Date ?
Below Java 8 examples shows how to convert from LocalDate to Date and vice versa.
Below Java 8 examples shows how to convert from LocalDate to Date and vice versa.
You can convert LocalDate object to dd/MM/yyyy using atStartOfDay() methods of LocalDate class. There are two ways to convert LocalDate to dd/MM/yyyy string. Let’s see those in the below example.
If you have epoch value and wanted to convert epoch milliseconds to ZonedDateTime then you can use ZonedDateTime.ofInstant() and Instant.ofEpochMilli() methods for the conversion.
It is very common that Java web services receives JSON string. If you wanted to convert JSON string to Jsonobject using Google Gson then there are two ways to achieve this. JSON string to JsonObject Example Google Gson is a… Read More!
When you deal with json object you may want to check whether key exists in the jsonobject before fetching value for that key. We can easily check using Google gson JsonObject has() method. has() method – Class JsonObject This is… Read More!