diff --git a/src/libs/zbxdbcache/dbcache.c b/src/libs/zbxdbcache/dbcache.c
index bc5f654e52..7b0a8fee53 100644
--- a/src/libs/zbxdbcache/dbcache.c
+++ b/src/libs/zbxdbcache/dbcache.c
@@ -3117,7 +3117,7 @@ void	zbx_log_sync_history_cache_progress(void)
 
 	LOCK_CACHE;
 
-	if (INT_MAX == cache->history_progress_ts)
+	if (ZBX_JAN_2038 == cache->history_progress_ts)
 	{
 		UNLOCK_CACHE;
 		return;
@@ -3137,7 +3137,7 @@ void	zbx_log_sync_history_cache_progress(void)
 		if (0 != cache->history_num_total)
 			pcnt = 100 * (double)(cache->history_num_total - cache->history_num) / cache->history_num_total;
 
-		cache->history_progress_ts = (0 == cache->history_num ? INT_MAX : sec);
+		cache->history_progress_ts = (0 == cache->history_num ? ZBX_JAN_2038 : sec);
 	}
 
 	ts_next = cache->history_progress_ts;
@@ -3150,7 +3150,7 @@ void	zbx_log_sync_history_cache_progress(void)
 	if (-1.0 != pcnt)
 		zabbix_log(LOG_LEVEL_WARNING, "syncing history data... " ZBX_FS_DBL "%%", pcnt);
 
-	if (INT_MAX == ts_next)
+	if (ZBX_JAN_2038 == ts_next)
 		zabbix_log(LOG_LEVEL_WARNING, "syncing history data done");
 }
 
