ActionScheduler_DateTime

Located in classes/ActionScheduler_DateTime.php.

Extension of PHP’s DateTime that supports explicit UTC offsets when a timezone string is not available.

Public Methods

getTimestamp()

Return the Unix timestamp for the object.

  • Returns: int

Notes:

  • Provides compatibility for PHP 5.2 by falling back to format( 'U' ) when needed.

setUtcOffset( $offset )

Set an explicit UTC offset (in seconds) when no timezone string is used.

  • Parameters: $offset (string|int)
  • Returns: void

getOffset()

Return the timezone offset for this object.

  • Returns: int

Notes:

  • If a UTC offset has been set with setUtcOffset(), that value is returned instead of the timezone offset.

setTimezone( $timezone )

Set a timezone and clear any explicit UTC offset.

  • Parameters: $timezone (DateTimeZone)
  • Returns: static

getOffsetTimestamp()

Get the Unix timestamp adjusted by the timezone offset.

  • Returns: int