mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-10 09:35:24 +02:00
[feature/new-tz-handling] Added phpbb_datetime::__toString().
New phpbb_datetime::__toString() magic method that formats the datetime according to the users default settings. PHPBB3-9558
This commit is contained in:
parent
c521ef1591
commit
dba89a5341
@ -124,6 +124,16 @@ class phpbb_datetime extends DateTime
|
|||||||
return strtr(parent::format($format['format_long']), $format['lang']);
|
return strtr(parent::format($format['format_long']), $format['lang']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Magic method to convert DateTime object to string
|
||||||
|
*
|
||||||
|
* @return Formatted date time, according to the users default settings.
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->format();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pre-processes the specified date format
|
* Pre-processes the specified date format
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user