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

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();

 

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!