php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74982 strftime %P not working on Alpine Linux
Submitted: 2017-07-24 18:18 UTC Modified: 2018-02-28 22:11 UTC
From: ryan at ryanparman dot com Assigned:
Status: Open Package: Date/time related
PHP Version: 7.1.7 OS: Alpine Linux 3.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-07-24 18:18 UTC] 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)`.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-24 19:10 UTC] danack@php.net
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.
 [2018-02-28 22:11 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: Date/time related
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Dec 11 22:01:26 2018 UTC