[aur-dev] [PATCH v2] Add user set timezones

Lukas Fleischer lfleischer at archlinux.org
Wed Nov 16 17:32:36 UTC 2016


On Wed, 16 Nov 2016 at 04:04:08, Mark Weiman wrote:
> Yeah, I chose something that was most likely long enough to hold anything that I
> needed to put in there. It looks like Johannes found it to be a maximum of 33
> characters, and after looking, the current maximum length is 30, so should I use
> 33 or 30?

It seems like 32 is a good value:

    $ backward=https://raw.githubusercontent.com/eggert/tz/master/backward
    $ curl -s "$backward" | sed '/^#/d' | cut -f3 | wc -L
    32

Johannes, where did you find a legacy name of length 33?

> When reading the timestamp in gmdate(), PHP doesn't care what timezone the
> default is set to and it just displays what the time is based on the how many
> seconds past the Unix epoch. Because of this, you have to get the timezone's
> offset (which is in UTC from the database) and do the math to make sure it's
> correct. I have verified this in a PHP shell. Changing the default doesn't make
> sense to me also because the application is only displaying other timezones, not
> working in them, only UTC.

We would have to use date() instead of gmdate() in combination with
date_default_timezone_set(), of course.

Regards,
Lukas


More information about the aur-dev mailing list