API15:JDate/toFormat
From Joomla! Documentation
Description
Gets the date in a specific format
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
toFormat($format= '%Y-%m-%d%H:%M:%S')
| Parameter Name | Default Value | Description |
|---|---|---|
| $format | '%Y-%m-%d%H:%M:%S' | $format The date format specification string (see ) |
Returns
a date in a specific format
Defined in
libraries/joomla/utilities/date.php
Importing
jimport( 'joomla.utilities.date' );
Source Body
function toFormat($format = '%Y-%m-%d %H:%M:%S')
{
$date = ($this->_date !== false) ? $this->_strftime($format, $this->_date + $this->_offset) : null;
return $date;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples