I was following the Qiskit textbook and wanted to show that $R_z (\pi/4) = e^{i \pi/8 Z}$.
Plugging $\pi/4$ in for $\theta$ in the matrix from this page $ \begin{bmatrix} e^{-i \pi/8} & 0 \\ 0 & e^{i \pi/8} \end{bmatrix}$, I end up with $\begin{bmatrix} \frac{1}{\sqrt{2}}-\frac{i}{\sqrt{2}} & 0 \\ 0 & \frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}} \end{bmatrix} $.
However, when I use the Euler's formula to go from $R_z (\pi/4) = e^{i \pi/8 Z}$ to $\cos(\pi/8)+i\sin(\pi/8)$, the matrix I end up with is $\begin{bmatrix} \frac{1}{\sqrt{2}}+\frac{i}{\sqrt{2}} & 0 \\ 0 & \frac{1}{\sqrt{2}}-\frac{i}{\sqrt{2}} \end{bmatrix} $.
It appears that one rotation is the opposite of the other. The way the Euler's formula is defined, is the rotational direction opposite of the other?