Finding Time Difference| Java Interview Question | Java Coding Question | Subscriber's Questions

Published: 19 April 2021
on channel: Arun Videos
134
2

You are given the current time R in the HH:MM:SS format.You are
also given N more time values in an array P, where every element
P[i] is less than or equal to R.

Write a program to calculate the time difference between P[i] and R
and print one of the following messages accordingly.
. If the time difference is zero,print now.
. If the time difference is in seconds but less than a minute,print X
seconds ago.
. If the time difference is in minutes but less than an hour,print X
minutes ago.Ignore the seconds part of the difference.

. If the time difference is in hours,print X hours ago.
Ignore the minutes and seconds part of the difference.

. If the value of X is 1, print the word second instead of seconds,
hour instead of hours and minute instead of minutes.


On this page of the site you can watch the video online Finding Time Difference| Java Interview Question | Java Coding Question | Subscriber's Questions with a duration of hours minute second in good quality, which was uploaded by the user Arun Videos 19 April 2021, share the link with friends and acquaintances, this video has already been watched 134 times on youtube and it was liked by 2 viewers. Enjoy your viewing!