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.
int $timestamp: A UNIX timestamp.
mixed $timezone: @see __construct()
array $settings: @see __construct()
static A new DateTimePlus object.
\Exception If the timestamp is not numeric.
public static function createFromTimestamp($timestamp, $timezone = NULL, $settings = array()) { if (!is_numeric($timestamp)) { throw new \Exception('The timestamp must be numeric.'); } $datetime = new static('', $timezone, $settings); $datetime->setTimestamp($timestamp); return $datetime; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Datetime!DateTimePlus.php/function/DateTimePlus::createFromTimestamp/8.1.x