This paper proposes a novel method called Spectral Invariant Learning for Dynamic Graphs under Distribution Shifts (SILD) to address distribution shifts in dynamic graphs. Dynamic graph neural networks (DyGNNs) face challenges in handling distribution shifts, particularly when these shifts occur in the spectral domain rather than the time domain. SILD introduces a framework that leverages spectral domain analysis to capture invariant and variant patterns in dynamic graphs. The method involves three key components: a DyGNN with Fourier transform to obtain ego-graph trajectory spectrums, a disentangled spectrum mask to separate invariant and variant patterns, and invariant spectral filtering to focus on invariant patterns for prediction under distribution shifts. The approach transforms dynamic graph data into the spectral domain using Fourier transforms, allowing the model to identify and utilize invariant patterns that remain stable across different distributions. Experimental results on both synthetic and real-world datasets demonstrate that SILD outperforms existing methods in node classification and link prediction tasks under distribution shifts. The method effectively handles distribution shifts by focusing on invariant patterns in the spectral domain, leading to improved generalization and robustness in dynamic graph learning scenarios.This paper proposes a novel method called Spectral Invariant Learning for Dynamic Graphs under Distribution Shifts (SILD) to address distribution shifts in dynamic graphs. Dynamic graph neural networks (DyGNNs) face challenges in handling distribution shifts, particularly when these shifts occur in the spectral domain rather than the time domain. SILD introduces a framework that leverages spectral domain analysis to capture invariant and variant patterns in dynamic graphs. The method involves three key components: a DyGNN with Fourier transform to obtain ego-graph trajectory spectrums, a disentangled spectrum mask to separate invariant and variant patterns, and invariant spectral filtering to focus on invariant patterns for prediction under distribution shifts. The approach transforms dynamic graph data into the spectral domain using Fourier transforms, allowing the model to identify and utilize invariant patterns that remain stable across different distributions. Experimental results on both synthetic and real-world datasets demonstrate that SILD outperforms existing methods in node classification and link prediction tasks under distribution shifts. The method effectively handles distribution shifts by focusing on invariant patterns in the spectral domain, leading to improved generalization and robustness in dynamic graph learning scenarios.