1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
miskamm [114]
3 years ago
15

Write a program that estimates how many years, months, weeks, days, and hours have gone by since Jan 1 1970 by calculations with

the number of seconds that have passed.
Computers and Technology
1 answer:
Rzqust [24]3 years ago
6 0

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));    

   }

}

You might be interested in
Why would you not restore a Domain Controller that was last backed up twelve months ago
Angelina_Jolie [31]

Answer:

All the data and information that was updated or added since then will be lost so it is useless to restore a Domain Controller that was backedup twelve months ago.

Explanation:

A domain conttoller back-up must be prepared on regular basis else if DC breaks, restoration of most recent database will be impossible.

7 0
3 years ago
Drag the system component on the left to the device or program that fits with the system component.
Strike441 [17]

Answer:

A. Back up software - Utility software

B. Printer - Device drivers

C. Camera - Firmware

D. Television - Firmware

E. Games console - Firmware

F. Antivirus software - Utility software

G. Disk Cleaner - Utility software

H. Video Card - Device drivers

Explanation:

Computer system components are the physical or hardware and software parts of the device. It is a combination of system software like utility software, device drivers and firmware, application software, and the hardware components and kernel.

4 0
3 years ago
Which of the following describes the main purpose of a model?
nalin [4]

Answer:

to demonstrate how something works.

Explanation:

hope it helps Brainlist?

8 0
3 years ago
EASY What does the Backspace key do?
arsen [322]

Answer:

Removes characters behind (or to the left of) the insertion point.

Explanation:

5 0
3 years ago
Ses
jekas [21]

Answer:

Amoung us

Explanation:

When the imposter is sus

8 0
3 years ago
Other questions:
  • Middleware for cloud database applications is commonly written as ____—short sections of code written in a programming or script
    11·1 answer
  • Jesse has finished typing an essay for her college assignment and submitted it. The next day she received an email from her prof
    15·2 answers
  • Ryan has made a presentation of ten slides, which he wants to display in sequence after a specific time interval. Which element
    9·2 answers
  • Unlike the climate of the other islands of Hawaii, ________Kona contains 54 different temperate zones.
    15·1 answer
  • Which type of transmission do modems use ?
    15·2 answers
  • What considerations have to be kept in mind with JPEG
    10·1 answer
  • Which feature does the web designer fail to apply in this layout for a web page? A. harmony
    8·2 answers
  • A typical day in programming and software development would involve
    12·1 answer
  • Terry visits the website www.examplewebsite.org. What can you gather about the site from the domain?
    8·1 answer
  • In two to three sentences, define "home row" and explain why it is important.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!