Bug #74982 [Com]: strftime %P not working on Alpine Linux
Edit report at https://bugs.php.net/bug.php?id=74982&edit=1
ID: 74982
Comment by: danack@php.net
Reported by: ryan at ryanparman dot com
Summary: strftime %P not working on Alpine Linux
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: Alpine Linux 3.4
PHP Version: 7.1.7
Block user comment: N
Private report: N
New Comment:
I believe this is the source for strftime on musl libc which is the C library used in Alphine linux:
http://git.musl-libc.org/cgit/musl/tree/src/time/strftime.c?id=ac0acd569e01735fc6052d43fdf57f3a07c93f3d
It does not appear to support "%P", which would make this a documentation issue.
Previous Comments:
------------------------------------------------------------------------
[2017-07-24 18:18:16] ryan at ryanparman dot com
Description:
------------
I'm using the official PHP Docker container "php:7.1.7-fpm-alpine", which is based on
Alpine Linux 3.4.
https://github.com/docker-library/php/blob/ddc7084c8a78ea12f0cfdceff7d03c5a530b787e/7.1/fpm/alpine/Dockerfile
When using strftime() on Alpine Linux, the %P modifier does not appear to be supported. When used,
the resulting value is (bool) false.
The documentation on http://php.net/strftime says:
> Mac OS X only: The %P modifier is not supported in the Mac OS X implementation of this
> function.
I would assume that the follow-up to this ticket would either be:
1. To update the documentation to explain that this modifier is unsupported on Alpine Linux in
addition to macOS. And/orâ¦
2. That this is a proper bug, and Alpine Linux support should be fixed at some point.
Test script:
---------------
https://gist.github.com/skyzyx/55e2dea4e7f8fbc6854b2c81f51e8cf9
Expected result:
----------------
I expect the result to be string(7) "06:12pm".
Actual result:
--------------
The actual result is bool(false).
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74982&edit=1
Thread (4 messages)