API15

JDate/toFormat

From Joomla! Documentation

< API15:JDate
Revision as of 17:25, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Gets the date in a specific format <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowik...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Gets the date in a specific format

[Edit Descripton]

Template:Description:JDate/toFormat

Syntax[edit]

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[edit]

a date in a specific format

Defined in[edit]

libraries/joomla/utilities/date.php

Importing[edit]

jimport( 'joomla.utilities.date' );

Source Body[edit]

function toFormat($format = '%Y-%m-%d %H:%M:%S')
{
        $date = ($this->_date !== false) ? $this->_strftime($format, $this->_date + $this->_offset) : null;

        return $date;
}

[Edit See Also] Template:SeeAlso:JDate/toFormat

Examples[edit]

<CodeExamplesForm />