Finding Date Conversion Rate Logic

39 Views Asked by At

I need your help to complete this sequence, I have to find the right logic to go from one date to another and thus find what the rate corresponds to.

For now, all I could find, and which seems pretty obvious, is the number of years between the two dates, but the decimal part is not very intuitive.

  • 04-09-2017 → 31-12-2022 = 5.3205
  • 04-09-2018 → 31-12-2022 = 4.3205
  • 29-09-2013 → 31-12-2022 = 9.2521
  • 28-03-2011 → 31-12-2022 = ?

My questions are therefore: What is the relationship between these values ​​(5.3205,4.3205,9.2521) and the dates that precede them? What logic makes it possible to achieve these values?

Thank you !

1

There are 1 best solutions below

3
On

After some simple computation, it's just the number of years between those dates, including decimals. The decimal tells you the fraction of the year passed.

This WolframAlpha query demonstrates one of them. In short - take the total number of days and divide by 365.