Datetime::formatExample

public static Datetime::formatExample($format)

Creates an example for a date format.

This is centralized for a consistent method of creating these examples.

Parameters

string $format:

Return value

string

File

core/lib/Drupal/Core/Datetime/Element/Datetime.php, line 372

Class

Datetime
Provides a datetime element.

Namespace

Drupal\Core\Datetime\Element

Code

public static function formatExample($format) {
  if (!static::$dateExample) {
    static::$dateExample = new DrupalDateTime();
  }
  return static::$dateExample->format($format);
}
doc_Drupal
2016-10-29 09:00:55
Comments
Leave a Comment

Please login to continue.