You are here

public static function Promotion::getDefaultStartDate in Commerce Core 8.2

Default value callback for 'start_date' base field definition.

Return value

string The default value (date string).

See also

::baseFieldDefinitions()

File

modules/promotion/src/Entity/Promotion.php, line 898

Class

Promotion
Defines the promotion entity class.

Namespace

Drupal\commerce_promotion\Entity

Code

public static function getDefaultStartDate() {
  $timestamp = \Drupal::time()
    ->getRequestTime();
  return gmdate(DateTimeItemInterface::DATETIME_STORAGE_FORMAT, $timestamp);
}