note 100926 added to function.date-diff
| From: | SergioAbreu at osu1 dot php dot net | Date: | Tue, 16 Nov 2010 00:33:20 +0000 |
| Subject: | note 100926 added to function.date-diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174052@lists.php.net to get a copy of this message | ||
<?php
/*
Thanks Mr Sven, for the workaround for Date Interval.
Here goes a suggestion of code to expand format possibilities */
// The second block of code inside the format function:
$format = preg_replace('/%?y/i', $this->y, $format);
$format = preg_replace('/%?m/i', $this->m, $format);
$format = preg_replace('/%?d/i', $this->d, $format);
$format = preg_replace('/%?h/i', $this->h, $format);
$format = preg_replace('/%?i/i', $this->i, $format);
$format = preg_replace('/%?s/i', $this->s, $format);
// This allows format without % as 'd/m/Y H:i:s'
?>
----
Server IP: 69.147.83.197
Probable Submitter: 189.79.164.34
----
Manual Page -- http://www.php.net/manual/en/function.date-diff.php
Edit -- https://master.php.net/note/edit/100926
Del: integrated -- https://master.php.net/note/delete/100926/integrated
Del: useless -- https://master.php.net/note/delete/100926/useless
Del: bad code -- https://master.php.net/note/delete/100926/bad+code
Del: spam -- https://master.php.net/note/delete/100926/spam
Del: non-english -- https://master.php.net/note/delete/100926/non-english
Del: in docs -- https://master.php.net/note/delete/100926/in+docs
Del: other reasons-- https://master.php.net/note/delete/100926
Reject -- https://master.php.net/note/reject/100926
Search -- https://master.php.net/manage/user-notes.php