I have this problem with calculating time difference in minutes.
Its working fine with exampples like calculating the difference between
2045 and 2300.
You can add if statement to check if this is today, and if no you can add one day to this, since you are comparing time it wont be problem if you add full day