<ul data-eligibleForWebStory="true">Self-supervised learning in time series analysis is gaining attention for reducing the need for labeled data and improving downstream tasks.Current methods struggle to capture both long-term dynamic evolution and subtle local patterns effectively.A new model called TimeDART is introduced, which unifies two generative paradigms for learning transferable representations.TimeDART uses a causal Transformer encoder and patch-based embedding strategy to capture evolving trends from left to right.The model also employs a denoising diffusion process to capture fine-grained local patterns through forward diffusion and reverse denoising.Optimization of the model is done in an autoregressive manner, effectively combining global and local sequence features.Extensive experiments on public datasets show that TimeDART outperforms existing methods in time series forecasting and classification tasks.The code for TimeDART is available at https://github.com/Melmaphother/TimeDART.