Class Misago\ActiveSupport\Datetime

Inheritence

Extends:
DateTime

Protected instance attributes

Methods

Public instance methods

__construct($time='now', $timezone=null)

Works like DateTime::__construct, but allows $timezone to be a string (the DateTimeZone object will be created automatically).

__toString()

distance($datetime)

Returns the distance between 2 dates as seconds.

is_valid()

strftime($format)

to_iso8601()

ATOM date format (ISO8601).

to_rfc2822()

RSS date format (RFC2822).

to_s($format=null)

Same as __toString, but permits to return a number instead of SQL formatted date.

$date = new ActiveSupport_Datetime('2009-09-23 14:32:59');
$date->to_s()         # => '2009-09-23 14:32:59'
$date->to_s('number') # => '20090923143259'