Mail archive

[alpine-user] PHP strftime does not seem to support %Z for timezone information

From: Tuukka Luolamo <>
Date: Thu, 29 Jun 2017 09:27:58 -0700

Executing "date" on my alpine Docker instance command line produces this for me

Thu Jun 29 08:39:28 PDT 2017

However if I execute this:

php -r "setlocale(LC_TIME, 'en_US'); date_default_timezone_set('America/Los_Angeles'); var_dump(strftime('%I:%M %p %Z', 1498568400));"

Alpine output:

'06:00 AM '

On Ubuntu I get instead:

'06:00 AM PDT'

I found this bug regarding strftime, but not sure it will address the timezone issue

Here is my docker file contents for reference:


FROM alpine:3.5

ENV TIMEZONE America/Los_Angeles

RUN apk update

RUN apk upgrade

RUN apk add --update tzdata

RUN cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime

RUN echo "${TIMEZONE}" > /etc/timezone

RUN apk add --update php5


Also using Alpine 3.6 has the same problem

Am I doing something wrong or missing a package or is this a bug and if so is there a reasonable workaround?



The information contained in this message may be confidential and/or constitute a privileged attorney-client document. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify McGraw-Hill Education immediately by replying to the message and deleting it from your computer. Thank you.

Received on Thu Jun 29 2017 - 09:27:58 UTC