I am not looking for a formula to calculate the difference of two dates. I am looking for a notation to express the difference of two dates in a formula.
Is there a common way to do that? If not what would be a good way to express that?
I am thinking of something like this:
$t = diff(D_1, D_2)$
where $t \ge 0$ is the number of days and $D_1$ and $D_2$ are two dates.
To express the difference of two quantities $Q_1$ and $Q_2$ in two different states $1$ and $2$ we use the $\mathop{\Delta{Q}}\limits_{1\to 2}=Q_2-Q_1$. Sometimes the states are clear so we just write $\Delta{Q}$ like with $\Delta{E}=(\Delta{m})c$. Sometimes we use $\mathop{\Delta{Q}}\limits_{Q_1\to Q_2}$ when we emphasize on the values. So in your case: $\mathop{\Delta{D}}\limits_{D_1\to D_2}=D_2-D_1$.
However, you should pay attention to what you make the difference for. If the difference is infinitesimally small, we use instead $d$ or $\delta$ like for $v=\frac{dx}{dt}$.