Objective. Accurate and timely prediction of epileptic seizures is crucial for empowering patients to mitigate their impact or prevent them altogether. Current studies predominantly focus on short-term seizure predictions, which causes the prediction time to be shorter than the onset of antiepileptic, thus failing to prevent seizures. However, longer epilepsy prediction faces the problem that as the preictal period lengthens, it increasingly resembles the interictal period, complicating differentiation. Approach. To address these issues, we employ the sample entropy method for feature extraction from electroencephalography (EEG) signals. Subsequently, we introduce the Anchoring Temporal Convolutional Networks (ATCN) model for longer-term, patient-specific epilepsy prediction. ATCN utilizes dilated causal convolutional networks to learn time-dependent features from previous data, capturing temporal causal correlations within and between samples. Additionally, the model also incorporates anchoring data to enhance the performance of epilepsy prediction further. Finally, we proposed a multilayer sliding window prediction algorithm for seizure alarms. Main results. Evaluation on the Freiburg intracranial EEG dataset shows our approach achieves 100% sensitivity, a false prediction rate (FPR) of 0.08 per hour and an average prediction time (APT) of 99.98 minutes. Using the CHB-MIT scalp EEG dataset, we a achieve 97.44% sensitivity, an FPR of 0.11 per hour, and an APT of 92.99 minutes. Significance. These results demonstrate that our approach is adequate for seizure prediction over a more extended prediction range on intracranial and scalp EEG datasets. The average prediction time of our approach exceeds the typical onset time of antiepileptic. This approach is particularly beneficial for patients who need to take medication at regular intervals, as they may only need to take their medication when our method issues an alarm. This capability has the potential to prevent seizures, which will greatly improving patients' quality of life.