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
What are the use of simple machine​
Advocard [28]

Answer:

Simple machines are useful because they reduce effort or extend the ability of people to perform tasks beyond their normal capabilities. Simple machines that are widely used include the wheel and axle, pulley , inclined plane, screw, wedge and lever.

Explanation:

7 0
3 years ago
People are more affected by technology than science because technology _____.
erik [133]
Has more of a direct influence in our everyday life because of the use of cellphones, technology, and cameras. Where else science is the idea that we should know affects us but often isn't clearly understood by the average person.

7 0
3 years ago
Read 2 more answers
In 3–5 sentences, explain how telecommunications technology helps workers do their jobs more efficiently.
Anvisha [2.4K]
Technology helps business professionals, keep more organized, communicate better, and efficiently keeps businesses secure. Technology helps keep employee information and business paper work more organized using computers and software; while making it easier to communicate with employee's using e-mail and memo's. With better alarm systems, camera's and online banking, security measures are endless. 

Hope this helped :)  <span />
4 0
3 years ago
Consider a movie database in which data is recorded about the movie industry. the data requirements are summarized as follows:
Ipatiy [6.2K]
There's incomplete question. But I suggest you to build ER diagram. You can use ERWin as it's the most user friendly program. You can find guides in the program. There're some tips how to build ER-diagram by given requirements.
3 0
4 years ago
The ________ is one of a number of major internet interconnection points that serve to tie all the isps together.
BARSIC [14]
<span>The Internet Exchange Point (IXP) is one of a number of major internet interconnection points that serve to tie all the ISPs (Internet Service Providers) together. This point is a physical infrastructure that allows ISPs to interconnect via several paths. Having more paths improves routing efficiency. </span>
4 0
4 years ago
Other questions:
  • You have just built a new system from scratch. you turn the computer on but the system boot fails and sounds a beep code. what m
    15·1 answer
  • Which of the following Wi-Fi chalking method refers to drawing symbols in public places to advertise open Wi-Fi networks?
    13·2 answers
  • You are reviewing the code written by another programmer, and encounter a variable whose name is entirely in capital letters. Wh
    15·1 answer
  • Choose a different well-known company that you know of, and describe its direct and indirect competitors. Describe at least 2 di
    9·2 answers
  • Who invented slide Rule and when?​
    7·2 answers
  • What are SmartArt graphics?
    10·1 answer
  • What is a man-in-the-middle attack​
    14·2 answers
  • Object Material: metal or non-metal? Prediction: Will the light bulb light up? Morm Observation: Does the light bulb light up? n
    5·1 answer
  • Describe the role of a distributed file system in a job execution environment such as MapReduce in a large-scale cloud system. g
    11·1 answer
  • Data erasure software uses standards that are called.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!