You are here

public static function PriceList::getDefaultStartDate in Commerce Pricelist 8.2

Default value callback for 'start_date' base field definition.

Return value

string The default value (date string).

See also

::baseFieldDefinitions()

File

src/Entity/PriceList.php, line 415

Class

PriceList
Defines the Price list entity.

Namespace

Drupal\commerce_pricelist\Entity

Code

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