You are here

public function DatexObject::setDatetime in Datex 7.2

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

Set date-time of object instance by extracting timestamp from given date.

Also calls conversion methods so internal values are set.

1 call to DatexObject::setDatetime()
DatexObject::__construct in datex_api/datex_api.class.inc
Constructor for DatexObject.

File

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

Class

DatexObject
Base class for localized DateTime.

Code

public function setDatetime($datetime, $tz = NULL) {
  $this
    ->checkSetTimezone($tz);
  $date = $this
    ->objectFromDate($datetime);
  $this
    ->setTimestamp($date
    ->getTimestamp());
  return $this;
}