import java.time.LocalDate;
import java.time.LocalTime;// from 时 代 Java - nowjava.com
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import static java.time.Month.JANUARY;
public class Main {
public static void main(String[] args) {
// Get current date, time, and datetime
LocalDate dateOnly = LocalDate.now();
LocalTime timeOnly = LocalTime.now();
LocalDateTime dateTime = LocalDateTime.now();
ZonedDateTime dateTimeWithZone = ZonedDateTime.now();
System.out.println("Current Date: " + dateOnly);
System.out.println("Current Time: " + timeOnly);
System.out.println("Current Date and Time: " + dateTime);
System.out.println("Current Date, Time, and Zone: " + dateTimeWithZone);/*from n o w j a v a . c o m*/
// Construct a birth date and time from date-time components
LocalDate myBirthDate = LocalDate.of(2000, JANUARY, 12);
/**代码未完, 请加载全部代码(NowJava.com).**/