diff options
author | Chris Smith <toonarmy@phpbb.com> | 2010-07-07 22:24:43 +0100 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-14 22:57:29 -0400 |
commit | dba89a534120d48d0ba901aedd69f962536bf36d (patch) | |
tree | 9c8c164c26f517ea520e048046ab505613aff2f9 /phpBB/includes/datetime.php | |
parent | c521ef1591022e69fe952ec23e6614ae36dee2e2 (diff) | |
download | forums-dba89a534120d48d0ba901aedd69f962536bf36d.tar forums-dba89a534120d48d0ba901aedd69f962536bf36d.tar.gz forums-dba89a534120d48d0ba901aedd69f962536bf36d.tar.bz2 forums-dba89a534120d48d0ba901aedd69f962536bf36d.tar.xz forums-dba89a534120d48d0ba901aedd69f962536bf36d.zip |
[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
Diffstat (limited to 'phpBB/includes/datetime.php')
-rw-r--r-- | phpBB/includes/datetime.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/phpBB/includes/datetime.php b/phpBB/includes/datetime.php index 577081e40b..8763697c78 100644 --- a/phpBB/includes/datetime.php +++ b/phpBB/includes/datetime.php @@ -125,6 +125,16 @@ class phpbb_datetime extends DateTime } /** + * 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 * * @param string $format Output format |