Skip to content

Instantly share code, notes, and snippets.

@lordofthejars
Created September 9, 2014 14:56
Show Gist options
  • Select an option

  • Save lordofthejars/c7a0b35b8af38fbb7997 to your computer and use it in GitHub Desktop.

Select an option

Save lordofthejars/c7a0b35b8af38fbb7997 to your computer and use it in GitHub Desktop.
ZoneId MADRID = ZoneId.of("Europe/Madrid");
LocalDate date = LocalDate.of(2014, Month.OCTOBER, 20);
LocalTime start = LocalTime.of(9, 45);
LocalTime end = LocalTime.of(10, 30);
Duration duration = Duration.ofMinutes(45);
assertThat(Duration.between(ZonedDateTime.of(date, end, MADRID), ZonedDateTime.of(date, start, MADRID)), is(duration));
Why it is different?
Expected: is <PT45M>
but: was <PT-45M>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment