API15

JHTML/date: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Returns formated date according to current local and adds time offset <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JHTML/date|Ed...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHTML/date|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JHTML/date}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 61: Line 61:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JHTML/date|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JHTML/date}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 76: Line 76:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Revision as of 17:22, 12 May 2013

Description

Returns formated date according to current local and adds time offset

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

date($date, $format=null, $offset=NULL)
Parameter Name Default Value Description
$date date in an US English date format
$format null format optional format for strftime
$offset NULL

Returns

string formated date

Defined in

libraries/joomla/html/html.php

Importing

jimport( 'joomla.html.html' );

Source Body

function date($date, $format = null, $offset = NULL)
{
        if ( ! $format ) {
                $format = JText::_('DATE_FORMAT_LC1');
        }



        if(is_null($offset))
        {
                $config =& JFactory::getConfig();
                $offset = $config->getValue('config.offset');
        }
        $instance =& JFactory::getDate($date);
        $instance->setOffset($offset);

        return $instance->toFormat($format);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />