code: public static long durationMS(LocalDateTime start,LocalDateTime end)
     {
        if(start == null || end == null)
        {
           return 0;
        }
        
        return Duration.between(start, end).toMillis();
     }
docs: The time between two dates
  @param start the begin time
  @param end the finish time
  @return duration in milliseconds