## [threeten-develop] Arithmetic Question

 [threeten-develop] Arithmetic Question From: Richard Warburton - 2011-11-10 23:48:55 ```I was having a look at some of the arithmetic operations in the API and I note that there exist operations between objects representing dates and times (for example LocalDateTime of OffsetDate) and periodproviders that return appropriate dates and times. There doesn't appear to be any arithmetic operation between two objects representing dates and times that returns a Period. I'm looking to be able to do something like: OffsetDatetime beginning = ...; OffsetDatetime end = ...; Period yourTripTook = end.minus(beginning); It seems like this kind of operation would be useful to have, as I imagine a lot of people will be given start and end dates for events and need to calculate how long they took. Perhaps I'm missing some conceptual reason as to why this is foolish, but I'd really to know what it is if so. kind regards, Richard ```

 [threeten-develop] Arithmetic Question From: Richard Warburton - 2011-11-10 23:48:55 ```I was having a look at some of the arithmetic operations in the API and I note that there exist operations between objects representing dates and times (for example LocalDateTime of OffsetDate) and periodproviders that return appropriate dates and times. There doesn't appear to be any arithmetic operation between two objects representing dates and times that returns a Period. I'm looking to be able to do something like: OffsetDatetime beginning = ...; OffsetDatetime end = ...; Period yourTripTook = end.minus(beginning); It seems like this kind of operation would be useful to have, as I imagine a lot of people will be given start and end dates for events and need to calculate how long they took. Perhaps I'm missing some conceptual reason as to why this is foolish, but I'd really to know what it is if so. kind regards, Richard ```
 Re: [threeten-develop] Arithmetic Question From: Richard Warburton - 2011-11-11 00:08:47 ```On 10/11/11 23:49, Richard Warburton wrote: > I was having a look at some of the arithmetic operations in the API > and I note that there exist operations between objects representing > dates and times (for example LocalDateTime of OffsetDate) and > periodproviders that return appropriate dates and times. There > doesn't appear to be any arithmetic operation between two objects > representing dates and times that returns a Period. I'm looking to be > able to do something like: > > OffsetDatetime beginning = ...; > OffsetDatetime end = ...; > Period yourTripTook = end.minus(beginning); > > It seems like this kind of operation would be useful to have, as I > imagine a lot of people will be given start and end dates for events > and need to calculate how long they took. Perhaps I'm missing some > conceptual reason as to why this is foolish, but I'd really to know > what it is if so. > > kind regards, > > Richard I don't know how I managed to miss Period.between, but you can ignore this question. regards, Richard ```