You are here

public function DatexObject::setDatetime in Datex 7

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

Set's date from given date.

For accepted list of accepted date formats, See DatexFormatter::ObjectFromDate.

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

File

datex_api/datex_api_classes.inc, line 715
API and helper functions used by other datex modules.

Class

DatexObject
This class is Jalali equivilant of php DateTime. It also has some functionallity from object defiend in Drupal's date module DateObject.

Code

public function setDatetime($datetime = NULL, $gregorian = DATEX_GREGORIAN, $tz = NULL) {
  $tz = DatexFormatter::getTzObject($tz);
  $this->dateobj = DatexFormatter::ObjectFromDate($datetime, $tz, $gregorian);
  return $this;
}