java.util.Date => It is a utility class to handles Date in our java program. => It represents both Date and Time java.sql.Date => It is designed class to handle Dates w.r.t DB operations => It represents only Date,but not Time. Note: In sql package Time(C) represents only => Time value TimeStamp(C) represents both => Date and Time value. Date and Time API: (Joda-Time API) Until Java 1.7 version the classes present in Java.util package to handle Date and Time (like Date, Calendar, TimeZone etc) are not up to the mark with respect to convenience and performance. To overcome this problem in the 1.8 version oracle people introduced Joda-Time API. This API developed by joda.org and available in Java in the form of "java.time" package. # program for to display System Date and time. import Java.time.*; public class DateTime { public static void main(String[] args) { LocalDate date = LocalDate.now(); System.out.println(date); LocalTime t...
Comments
Post a Comment