You are here

public function DatexObject::reset in Datex 7.2

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

When new date or time is set on object, This method must be called.

Gives a chance to extended classes to recalculate converted date from new date.

3 calls to DatexObject::reset()
DatexObject::setTimestamp in datex_api/datex_api.class.inc
Same as DateTime::setTimestamp but also resets the object.
DatexObject::setTimezone in datex_api/datex_api.class.inc
Sets Time Zone of internal date object.
DatexObject::xsetDate in datex_api/datex_api.class.inc
Same as DateTime::setDate().

File

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

Class

DatexObject
Base class for localized DateTime.

Code

public function reset($reset_datetime = NULL) {

  // If no timestamp, Then just recalculate date and set timezone.
  if ($reset_datetime !== NULL) {
    $this
      ->setTimestamp(time());
  }
  $this->tzOffset = $this
    ->xformat('Z');
  $this
    ->setConvert();
  $this
    ->setIsLeap();
  return $this;
}