This error occurs when upgrading to drupal 9.

Fix Call to deprecated constant REQUEST_TIME: Deprecated in drupal:8.3.0

Solution

Use the following instead:

\Drupal::time()->getRequestTime();