Answer:
Explanation:
The following code is written in Java. It uses the LocalDate import to get the number of seconds since the epoch (Jan 1, 1970) and then uses the ChronoUnit import class to transform those seconds into years, months, weeks days, and hours. Finally, printing out each value separately to the console. The output of the code can be seen in the attached picture below.
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
class Brainly {
public static void main(String[] args) {
LocalDate now = LocalDate.now();
LocalDate epoch = LocalDate.ofEpochDay(0);
System.out.println("Time since Jan 1 1970");
System.out.println("Years: " + ChronoUnit.YEARS.between(epoch, now));
System.out.println("Months: " + ChronoUnit.MONTHS.between(epoch, now));
System.out.println("Weeks: " + ChronoUnit.WEEKS.between(epoch, now));
System.out.println("Days: " + ChronoUnit.DAYS.between(epoch, now));
System.out.println("Hours: " + (ChronoUnit.DAYS.between(epoch, now) * 24));
}
}