|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ryan at ryanparman dot com
New email:
PHP Version: OS:


 [2017-07-24 18:18 UTC] ryan at ryanparman dot com
I'm using the official PHP Docker container "php:7.1.7-fpm-alpine", which is based on Alpine Linux 3.4.

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 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:

Expected result:
I expect the result to be `string(7) "06:12pm"`.

Actual result:
The actual result is `bool(false)`.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-07-24 19:10 UTC]
I believe this is the source for strftime on musl libc which is the C library used in Alphine linux:

It does not appear to support "%P", which would make this a documentation issue.
 [2018-02-28 22:11 UTC]
-Package: Unknown/Other Function +Package: Date/time related
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Mar 05 21:01:24 2021 UTC