note 126693 added to function.strftime
| From: | bohwaz at main dot php dot net | Date: | Fri, 17 Dec 2021 18:51:03 +0000 |
| Subject: | note 126693 added to function.strftime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217385@lists.php.net to get a copy of this message | ||
If you are targeting PHP 8.1+ (or even if you are targeting PHP 7 or 8.0) you can replace your calls
to strftime with this small self-contained function that will provide the same features. This works
with all locales, even if they're not installed on the OS, and it accepts DateTime objects.
https://gist.github.com/bohwaz/42fc223031e2b2dd2585aab159a20f30
Please note that extensions from glibc are not supported (see https://man7.org/linux/man-pages/man3/strftime.3.html#NOTES
for details) as they never were documented in PHP in the first place (but it worked).
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 193.57.124.22)
----
Manual Page -- https://php.net/manual/en/function.strftime.php
Edit -- https://main.php.net/note/edit/126693
Del: integrated -- https://main.php.net/note/delete/126693/integrated
Del: useless -- https://main.php.net/note/delete/126693/useless
Del: bad code -- https://main.php.net/note/delete/126693/bad+code
Del: spam -- https://main.php.net/note/delete/126693/spam
Del: non-english -- https://main.php.net/note/delete/126693/non-english
Del: in docs -- https://main.php.net/note/delete/126693/in+docs
Del: other reasons-- https://main.php.net/note/delete/126693
Reject -- https://main.php.net/note/reject/126693
Search -- https://main.php.net/manage/user-notes.php