Back to Date class

Method getInstance

public static \Joomla\CMS\Date\Date
getInstance
(mixed $date = 'now', mixed $tz = null)
Proxy for new Date().
Parameters
  • string $date String in a format accepted by strtotime(), defaults to "now".
  • mixed $tz Time zone to be used for the date.
Returns
  • \Joomla\CMS\Date\Date
Since
  • 1.7.3
Class: Date
Project: Joomla

Method getInstance - Source code

/**
 * Proxy for new Date().
 *
 * @param   string  $date  String in a format accepted by strtotime(), defaults to "now".
 * @param   mixed   $tz    Time zone to be used for the date.
 *
 * @return  Date
 *
 * @since   1.7.3
 */
public static function getInstance($date = 'now', $tz = null)
{
    return new static($date, $tz);
}