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]
2 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]2 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
How many check boxes from the following code can be selected at any given time? Home Address Federal Express UPS
Ahat [919]

Answer:

The answer to the given question is "3".

Explanation:

  • In the given HTML checkboxes code. We used input type= "checkbox" that provide a checkbox. That is used to select one or more options on the limited number of choices.  
  • In this code, we use check three checkbox that is "Home Address, Federal Express and UPS" in this checkboxes code we use the name attribute that works as a reference this attribute is used to submit data into the database.  

In this code, we select(check) in all three checkboxes that's why the answer to this question is "3".

5 0
3 years ago
Help me pleseeeeee i will mark u as brainliest
Dovator [93]

Answer:

<!DOCTYPE html>

<html>

 <head>

 <style>

 #header {  

   text-align: center;

   float: left;

 }

 #langtable {

   border: 2px solid blue;

   border-spacing: 5px;

 }

 #langtable th {

     border: 2px solid green;

 }

 #langtable td {

     border: 2px solid green;

     padding: 10px;

 }

 </style>

 </head>

 <body>

   <div id="header">State and languages

   <table id="langtable">

     <tr>  

       <th>State</th>

       <th>Major Spoken Language</th>

     </tr>

     <tr>

       <td>Punjab</td>

       <td>Punjabi</td>

     </tr>

     <tr>

       <td>Jammu and Kashmir</td>

       <td>Kashmiri</td>

     </tr>

     <tr>

       <td>West Bengal</td>

       <td>Bengali</td>

     </tr>

   </table>

   </div>

 </body>

</html>

Explanation:

I think this looks pretty much like it.

7 0
3 years ago
A cell in a spreadsheet can contain _________?
serg [7]
The correct answer is All of these :)
3 0
3 years ago
Dwight <br> d. eisenhower was impressed with germany's network of highways and how it __________.
emmasim [6.3K]
Eased the mobilization and transportation of troops
5 0
3 years ago
Sarah has to add a picture from her computer file and add a caption to it. Arrange the steps in a correct sequence.
SVEN [57.7K]
Click Insert
click Picture
click From File
select the desired picture and again click insert
right-click the picture
click Insert Caption
write the caption and add it
5 0
3 years ago
Read 2 more answers
Other questions:
  • The critical path of a network is the A. shortest time path through the network. B. path with the most activities. C. longest ti
    8·1 answer
  • What is the service provided by a third party (such as an ISP) that enables you to connect another cloud directly to your Google
    15·1 answer
  • Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() pri
    12·1 answer
  • The simplest method to copy information is to first select the information you want to copy, and then use the Copy button and th
    11·1 answer
  • What is the most common concern with using variable frequency drives?
    6·1 answer
  • Which option describes wearable technology?
    9·1 answer
  • Select the correct answer from each drop down menu
    8·2 answers
  • Write a program that repeatedly reads in integers until a negative integer is read. The program keeps track of the largest integ
    9·1 answer
  • When you save a presentation with a .potx file extension, which type of powerpoint file is created?
    8·1 answer
  • the human resources department requests a list that contains the number (i.e. count) of orders taken on each date, grouped by th
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!