You are here

public function DateObject::hasTime in Date 7

Same name and namespace in other branches
  1. 7.3 date_api/date_api.module \DateObject::hasTime()
  2. 7.2 date_api/date_api.module \DateObject::hasTime()

Returns whether this object has time set. Used primarily for timezone conversion and formatting.

1 call to DateObject::hasTime()
DateObject::setTimezone in date_api/date_api.module
Overrides default DateTime function. Only changes output values if actually had time granularity. This should be used as a "converter" for output, to switch tzs.

File

date_api/date_api.module, line 298
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Class

DateObject
Extend PHP DateTime class with granularity handling, merge functionality and slightly more flexible initialization parameters.

Code

public function hasTime() {
  return $this
    ->hasGranularity('hour');
}