DateTimePlus::prepareTime

protected DateTimePlus::prepareTime($time) Prepares the input time value. Changes the input value before trying to use it, if necessary. Can be overridden to handle special cases. Parameters mixed $time: An input value, which could be a timestamp, a string, or an array of date parts. Return value mixed The massaged time. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 373 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code protected function p

DateTimePlus::prepareFormat

protected DateTimePlus::prepareFormat($format) Prepares the input format value. Changes the input format before trying to use it, if necessary. Can be overridden to handle special cases. Parameters string $format: A PHP format string. Return value string The massaged PHP format string. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 425 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code protected function prepareFormat($format) { return $fo

DateTimePlus::prepareArray

public static DateTimePlus::prepareArray($array, $force_valid_date = FALSE) Creates a complete array from a possibly incomplete array of date parts. Parameters array $array: An array of date values keyed by date part. bool $force_valid_date: (optional) Whether to force a valid date by filling in missing values with valid values or just to use empty values instead. Defaults to FALSE. Return value array A complete array of date parts. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, li

DateTimePlus::hasErrors

public DateTimePlus::hasErrors() Detects if there were errors in the processing of this date. Return value bool TRUE if there were errors in the processing of this date, FALSE otherwise. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 462 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code public function hasErrors() { return (boolean) count($this->errors); }

DateTimePlus::getErrors

public DateTimePlus::getErrors() Gets error messages. Public function to return the error messages. Return value array An array of errors encountered when creating this date. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 474 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code public function getErrors() { return $this->errors; }

DateTimePlus::FORMAT

File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 30 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code const FORMAT = 'Y-m-d H:i:s';

DateTimePlus::format

public DateTimePlus::format($format, $settings = array()) Formats the date for display. Parameters string $format: A format string using either PHP's date(). array $settings: timezone: (optional) String timezone name. Defaults to the timezone of the date object. Return value string The formatted value of the date. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 630 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code public function format($

DateTimePlus::diff

public DateTimePlus::diff($datetime2, $absolute = FALSE) Returns the difference between two DateTimePlus objects. Parameters \Drupal\Component\Datetime\DateTimePlus|\DateTime $datetime2: The date to compare to. bool $absolute: Should the interval be forced to be positive? Return value \DateInterval A DateInterval object representing the difference between the two dates. Throws \BadMethodCallException If the input isn't a DateTime or DateTimePlus object. File core/lib/Drupal/Component/Datetim

DateTimePlus::datePad

public static DateTimePlus::datePad($value, $size = 2) Pads date parts with zeros. Helper function for a task that is often required when working with dates. Parameters int $value: The value to pad. int $size: (optional) Size expected, usually 2 or 4. Defaults to 2. Return value string The padded value. File core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 614 Class DateTimePlus Wraps DateTime(). Namespace Drupal\Component\Datetime Code public static function datePad($value,

DateTimePlus::createFromTimestamp

public static DateTimePlus::createFromTimestamp($timestamp, $timezone = NULL, $settings = array()) Creates a date object from timestamp input. The timezone of a timestamp is always UTC. The timezone for a timestamp indicates the timezone used by the format() method. Parameters int $timestamp: A UNIX timestamp. mixed $timezone: @see __construct() array $settings: @see __construct() Return value static A new DateTimePlus object. Throws \Exception If the timestamp is not numeric. File core/lib/