You are here

public static function TimestampHelper::subtractInterval in Node expire 7.2

Subtarcts string interval to timestamp.

File

src/Module/CommonExpire/Conversion/TimestampHelper.php, line 114
TimestampHelper class.

Class

TimestampHelper
TimestampHelper class.

Namespace

Drupal\node_expire\Module\CommonExpire\Conversion

Code

public static function subtractInterval($interval, $timestamp) {
  $dt = new \DateTime('@' . $timestamp);
  $dt
    ->sub(\DateInterval::createFromDateString($interval));
  $ts = $dt
    ->getTimestamp();
  return $ts;
}