The definition of Macaulay's Duration is the weighted average maturity of cash flows and is calculated as-
$$D_{mac}=\frac{\sum_ttPV(C_t)}{V}$$
where $PV(C_t)$ is the present value of the cash flow at time t of the bond in question while $V$ is the current dirty price of the bond.
The $PV(C_t)$ is calculated as $e^{-yt}C_t$ where $y$ is the Yield to Maturity of the bond.
My question is regarding this choice of discounting. Could we use the zero rates instead of the flat yield to calculate the $PV(C_t)$? In the case of a bond price it wouldn't make a difference since the yield to maturity is calculated assuming that it's the flat rate that allows your discounted net present value to equal the one that you got using the zero rates.
$$\sum_tC_tZ(0,t)=\sum_tC_te^{-yt}$$
But in the case of time weighted cash flows the two sums would be different.