Anomaly detection in time series has become an important aspect of data analysis and has many applications. Anomaly detection is often a challenge for statistical and pattern detection modeling. We introduce TTDD (Test, Transform, Decompose, and Detection), a pattern-based detector to detect outlier values in time series datasets. TTDD splits each time series into three components, each representing an underlying pattern category. Trend, seasonality, and residual. The outlier is determined for each component separately, which contributes to determining the outlier with high accuracy. The lag in the timing between the test set and the training set was discovered using Fourier transforms. In contrast to previous work, we support time series that are phase shifted. TTDD is resilient to consecutively outlier values with different types. The experimental results are based on real-world and benchmark datasets. The proposed TTDD framework outperforms the other methods with higher accuracy score at 95% which is higher than those of other methods about 15%. Furthermore, it can detect the delay time outliers that other methods cannot easily identify.