Calculate Macaulay duration as the weighted average time to receive all cash flows (coupons + principal), weighted by present value of each cash flow as a fraction of total bond price.
Use the full interactive calculator below, or
Modified Duration
Finance Long-tail
Bond Price YTM