You are here

public static function BlockedIpsExpireTestCase::randomDatetimeInPast in Blocked IPs Expire 7

Generates a random date in the past.

Return value

\DateTime A datetime object representing this random date.

File

tests/blocked_ips_expire.base.test, line 179
Contains \BlockedIpsExpireTestCase.

Class

BlockedIpsExpireTestCase
An object containing test functions common to all tests for this module.

Code

public static function randomDatetimeInPast() {
  $current_datetime = time();
  return self::randomDatetime(0, $current_datetime);
}