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
Word Bank:
NNADVOKAT [17]

Explanation:

circle with radius and colour red

3 0
3 years ago
Select the correct answer.
Umnica [9.8K]

Answer:

OB. by zooming in on them

hope it helps

7 0
3 years ago
What Security Issu E Commerce ?​
Andre45 [30]

Answer:

e means we don't know so I can't tell the answer

5 0
3 years ago
Intuit, a tax and financial planning software company, creates a website where its QuickBooks customers can interact about probl
andrey2020 [161]

Answer:

Digitalization

Explanation:

Instead of doing it manually they created one web site to interact with the customers through Internet and computer. so it is an example of digitalization where user avoids manual interaction

8 0
3 years ago
Drag each tile to the correct box.
SVEN [57.7K]

  • Learning : For performing any task you need to learn from the basiscs .
  • planning : planning is the main part . unless and until you dont know how to design and what to design , what will you design ?
  • Designing : After laying a layer of well set up plane u need to look up , and break your head in physically implying it .
  • Devaloped : This place is where you detect flaws in your system , work with that and makes it even better .
  • Testing and delevering : The product is designed , U just need to test and delever it to consumers .
6 0
4 years ago
Other questions:
  • A security policy is a
    11·1 answer
  • A service provider, hardware, and web browser are needed to connect to __________.
    8·2 answers
  • What statement best decribes the relashionship bewteen science and technoligy?
    11·2 answers
  • The geographic coordinate system is used to represent any location on Earth as a combination of latitude and longitude values. T
    5·1 answer
  • The computer output for integer programs in the textbook does not include reduced costs, dual values, or sensitivity ranges beca
    14·1 answer
  • Which two options are negotiated via ncp during the establishment of a ppp connection that will use the ipv4 network layer proto
    7·1 answer
  • Expectation on Information Technology Fundamental​
    12·1 answer
  • Discuss five domains of Instructional technology​
    7·1 answer
  • Bryan's company is new and has limited funds to work with. He has been tasked with finding a telecommunications technology that
    7·1 answer
  • Which button on a desktop computer begins a reboot of the computer without power being removed from the computer's components?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!