localdate/local time and LocalDateTime class simplifies time zones without the need for development.
Let's take a look at their operation.
Choose to use any editor to create the following Java program in c:/> Java
Java8tester.java
Import java.time.localdate;import java.time.localtime;import java.time.localdatetime;import java.time.month;public class java8tester { public static void main (string args[]) { java8tester java8tester = New java8tester (); java8tester.testlocaldatetime (); } public void testlocaldatetime () { // get the current date and time localdatetime currenttime = localdatetime.now (); system.out.println ("current datetime: " + currenttime); localdate date1 = currenttime.tolocaldate (); System.out.println ("date1: " + date1"); month month = currenttime.getmonth (); int day = currenttime.getdayofmonth (); int seconds = currenttime.getsecond (); System.out.println ("month: " + month + "Day : " + day +" seconds: " + seconds ); localdatetime date2 = currenttime.withdayofmonth (withyear); System.out.println ("date2: " + date2); //12 december 2014 localdate date3 = localdate.of (2014, MONTH.DECEMBER, 12); system.out.println ("date3: " + date3); // 22 hour 15 minutes localtime date4 = Localtime.of (22, 15); system.out.println ("date4: " +  DATE4); //parse a string localtime date5 = localtime.parse ("20:15:30"); System.out.println ("date5: " + date5); }}
Validation results
Click on the link to view the details
Java8 local datetime API