You are here

public function DatexObject::__construct in Datex 7.2

Same name and namespace in other branches
  1. 7 datex_api/datex_api_classes.inc \DatexObject::__construct()

Constructor for DatexObject.

Parameters

mixed $datetime: For list of accepted values see objectFromDate().

mixed $tz: DateTimeZone to use, Can be DateTimeZone object or name string of it.

string $format: Default format string.

bool $use_intl: Whether to use PHP-Intl or not.

File

datex_api/datex_api.class.inc, line 172
Provides an API to work with dates.

Class

DatexObject
Base class for localized DateTime.

Code

public function __construct($datetime = NULL, $tz = NULL, $format = '', $use_intl = DATEX_USE_INTL) {
  parent::__construct();
  $this
    ->setUseINTL($use_intl);
  $this
    ->setDatetime($datetime, $tz);
  $this
    ->setFormat($format);
  return $this;
}