|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
A class used to format dates/times. More...
Inheritance diagram for Erebot\Styling\Variables\DateTimeVariable:Public Member Functions | |
| __construct ($value, $datetype, $timetype, $timezone=null) | |
| getDateType () | |
| getTimeType () | |
| getTimeZone () | |
| getValue () | |
| render (\Erebot\IntlInterface $translator) | |
Protected Attributes | |
| $datetype | |
| Type of rendering to apply to dates. | |
| $timetype | |
| Type of rendering to apply to times. | |
| $timezone | |
| Timezone to use during the rendering prcess. | |
| $value | |
| A value expressing a date/time. | |
A class used to format dates/times.
Definition at line 27 of file DateTimeVariable.php.
| Erebot\Styling\Variables\DateTimeVariable::__construct | ( | $value, | |
| $datetype, | |||
| $timetype, | |||
$timezone = null |
|||
| ) |
Constructor.
| mixed | $value | A value representing a date/time that will be formatted. This may be a DateTime object, an integer representing a Unix timestamp value (seconds since epoch, UTC) or an array in the format output by localtime(). |
| opaque | $datetype | The type of rendering to apply to dates. This is one of the constants defined in http://php.net/manual/en/class.intldateformatter.php |
| opaque | $timetype | The type of rendering to apply to times. This is one of the constants defined in http://php.net/manual/en/class.intldateformatter.php |
| string | null | $timezone | (optional) Timezone to use when rendering dates/times, eg. "Europe/Paris". The default is to use the system's default timezone, as returned by date_default_timezone_get(). |
Definition at line 67 of file DateTimeVariable.php.
References Erebot\Styling\Variables\DateTimeVariable\$datetype, Erebot\Styling\Variables\DateTimeVariable\$timetype, Erebot\Styling\Variables\DateTimeVariable\$timezone, and Erebot\Styling\Variables\DateTimeVariable\$value.
| Erebot\Styling\Variables\DateTimeVariable::getDateType | ( | ) |
Returns the type of rendering used for dates.
| opaque | The type of rendering used for dates. This is one of the constants defined in http://php.net/manual/en/class.intldateformatter.php |
Implements Erebot\Styling\Variables\DateTimeInterface.
Definition at line 95 of file DateTimeVariable.php.
References Erebot\Styling\Variables\DateTimeVariable\$datetype.
| Erebot\Styling\Variables\DateTimeVariable::getTimeType | ( | ) |
Returns the type of rendering used for times.
| opaque | The type of rendering used for dates. This is one of the constants defined in http://php.net/manual/en/class.intldateformatter.php |
Implements Erebot\Styling\Variables\DateTimeInterface.
Definition at line 100 of file DateTimeVariable.php.
References Erebot\Styling\Variables\DateTimeVariable\$timetype.
| Erebot\Styling\Variables\DateTimeVariable::getTimeZone | ( | ) |
Returns the timezone used to format values.
| string | The name of the timezone used to format dates and times (eg. "Europe/Paris"). |
| NULL | NULL is returned in case no timezone was specified during this object's creation. In that case, the current timezone of the system is used to render dates/times. |
Implements Erebot\Styling\Variables\DateTimeInterface.
Definition at line 105 of file DateTimeVariable.php.
References Erebot\Styling\Variables\DateTimeVariable\$timezone.
| Erebot\Styling\Variables\DateTimeVariable::getValue | ( | ) |
Returns the value stored in this object.
| mixed | Value stored in this object. |
Implements Erebot\Styling\VariableInterface.
Definition at line 90 of file DateTimeVariable.php.
References Erebot\Styling\Variables\DateTimeVariable\$value.
| Erebot\Styling\Variables\DateTimeVariable::render | ( | \Erebot\IntlInterface | $translator | ) |
Renders the content of this variable.
| Erebot::IntlInterface | $translator | A translator that can be used to change the rendering depending on the target locale. |
| string | The variable rendered as a string. |
Implements Erebot\Styling\VariableInterface.
Definition at line 75 of file DateTimeVariable.php.
References Erebot\Styling\Variables\DateTimeVariable\$datetype, Erebot\Styling\Variables\DateTimeVariable\$timetype, Erebot\Styling\Variables\DateTimeVariable\$timezone, and Erebot\IntlInterface\LC_TIME.