Get minutes between two working days in Java

前端 未结 1 805
时光取名叫无心
时光取名叫无心 2020-12-22 09:21

I am trying to calculate the minutes between two Joda DateTimes or Calendars in Java. Ofcourse this would be simple if I could use the Minutes.minutesBetween function, but I

相关标签:
1条回答
  • 2020-12-22 09:29

    a pseudocode solution might look something like the below.

    onSameWorkDay?
    
        if yes
            simple date comparison
        if no
            days = find number of whole work days between the two dates
            dayToMin = days * 8 * 60
            minDay1 = find minutes between specified start time and end of day1
            minDay2 = find minutes between start of final day and specified end time
            totalTime = dayToMin + minDay1 + minDay2
    
    0 讨论(0)
提交回复
热议问题