Mail archive
alpine-user

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

From: Tuukka Luolamo <tuukka.luolamo_at_mheducation.com>
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 https://bugs.alpinelinux.org/issues/5907

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?


Thanks,


Tuukka

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.



---
Unsubscribe:  alpine-user+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-user+help_at_lists.alpinelinux.org
---
Received on Thu Jun 29 2017 - 09:27:58 GMT