Skip to content

Instantly share code, notes, and snippets.

@tarchan
Created April 7, 2014 07:00
Show Gist options
  • Save tarchan/10015847 to your computer and use it in GitHub Desktop.
Save tarchan/10015847 to your computer and use it in GitHub Desktop.
public static final DateTimeFormatter TIME_PATTERN = DateTimeFormatter.ofPattern("HHmm");
public BigDecimal getRealKosu() {
LocalTime start = LocalTime.parse(strTime, TIME_PATTERN);
LocalTime end = LocalTime.parse(endTime, TIME_PATTERN);
LocalTime rest = LocalTime.parse(restTime, TIME_PATTERN);
Duration du = Duration.between(start, end);
Duration du2 = Duration.between(LocalTime.MIN, rest);
Duration du3 = du.minus(du2);
return new BigDecimal(du3.toMinutes() / 60.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment