Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import static java.time.temporal.ChronoUnit.DAYS;

import java.time.LocalDate;
import java.time.Month;
import java.time.Period;

public class Main {
    public static void main(String[] argv) {
        LocalDate startEmployment = LocalDate.of(2010, Month.SEPTEMBER, 8);
        LocalDate today = LocalDate.now();
        Period period = startEmployment.until(today);
        System.out.println("period = " + period);
        long numberOfDays = startEmployment.until(today, DAYS);
        System.out.println("numberOfDays = " + numberOfDays);
    }
}