Calculate Time difference in Java


public static long checkTimeDifference(String time1,String time2){
     
         //time1 and time 2 must be in HH:mm:ss format

    SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
    Date date1;
    Date date2;
    long difference=0;
try {
date1 = format.parse(time1);
date2 = format.parse(time2);
difference = date2.getTime() - date1.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
return difference;
   
    }

Comments

  1. Your car could be stolen if you don't remember this!

    Imagine that your car was taken! When you visit the police, they inquire about a particular "VIN lookup"

    Describe a VIN decoder.

    Similar to a passport, the "VIN decoder" allows you to find out the date of the car's birth and the identity of its "parent" (manufacturing facility). You can also find out:

    1.Type of engine

    2.Model of a vehicle

    3.The DMV and the limitations it imposes

    4.The number of drivers in this vehicle

    You'll be able to locate the car, and keeping in mind the code ensures your safety. The code can be examined in the online database. The VIN is situated on various parts of the car to make it harder for thieves to steal, such as the first person sitting on the floor, the frame (often in trucks and SUVs), the spar, and other areas.

    What if the VIN is intentionally harmed?

    There are numerous circumstances that can result in VIN damage, but failing to have one will have unpleasant repercussions because it is illegal to intentionally harm a VIN in order to avoid going to jail or calling the police. You could receive a fine of up to 80,000 rubles and spend two years in jail. You might be stopped by an instructor on the road.

    Conclusion.

    The VIN decoder may help to save your car from theft. But where can you check the car reality? This is why we exist– VIN decoders!

    ReplyDelete
  2. Чтобы иметь право рулить погрузчиком, нужно пройти специфическое обучение и успешно сдать экзамены, указывающие знания в этой области. Права тракториста-машиниста выдается в Гостехнадзоре и в обязательном порядке для тех, кто задумывает трудиться на специальной технике - https://onpravar.com/spectehnika/pogruzchik

    ReplyDelete

Post a Comment

Popular posts from this blog

Read Images from a xlsx file using Apache POI

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

How to create mail message in FRC822 format