Topic: tzdata with-system-tzdata different behavior

Hello,

first of all ... Thanks a lot for your packages an everything arround!!!

We might have a problem "again" with timestamps due to tzdata-usage. Before we used a self-compiled version php-5.6.10. Now we are using remi-php-5.6.10 ;-).

From Bash-Shell
$ export TZ="Europe/Berlin"; date --date='TZ="Europe/Berlin" 0001-01-01 00:00:00' +%s => -62135600008

If we want to get a timestamp in seconds for out Timezone "Europe/Berlin" since 01.01.0001 ;-) we got a wrong result (-62135600400) before php-5.6.9.
Maybe you take a look here: http://3v4l.org/JIvSC.
With php-5.6.9+ we got the right result (-62135600008).

Now with remi-php-5.6.9+ with the tzdata-Patch (--with-system-tzdata) we got a wrong result again (-62135600400).
-> RPM installed => tzdata-2015d-1.el6.noarch

That`s why i complied the remi-source of php-5.6.11 without "--with-system-tzdata" (so use the internal tzdata-DB) an the result was as expected correct: => -62135600008

My Question now:
- Is it a bug from the patch?
- Is it a bug from system-tzdata
- Everything else?

May you can help us?

Bye

Re: tzdata with-system-tzdata different behavior

With php 5.6.11, on Fedora 21 (tzdata-2015e-1.fc21.noarch):

$ php -r 'ini_set("date.timezone", "Europe/Berlin"); $timestamp = new DateTime();
> $timestamp->setDate(1, 1, 1);
> $timestamp->setTime(0, 0, 0);
> echo $timestamp->getTimestamp();
> echo  $timestamp->format("\nY-m-d H:i:s\n");'
-62135600008
0001-01-01 00:00:00

ON centOS 6 (tzdata-2015e-1.el6.noarch)

$ php -r 'ini_set("date.timezone", "Europe/Berlin"); $timestamp = new DateTime();
> $timestamp->setDate(1, 1, 1);
> $timestamp->setTime(0, 0, 0);
> echo $timestamp->getTimestamp();
> echo  $timestamp->format("\nY-m-d H:i:s\n");'
-62135600400
0001-01-01 00:00:00

Strange... I don't see any explanation for such a diff.
I will try to dig on this.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: tzdata with-system-tzdata different behavior

Despite the timestamp is diff, the date is the same.

I know a new transition (for INT_MIN) have be add in recent timezone (Fedora 21+) as in new PHP (5.5.25+ and 5.6.9+)
I don't think we can fix this easily.

The behavior have change between 5.5.24 and 5.5.25.
Fedora 21+ have the new behavior (system tzdata build with new zic from glibc 2.20)
RHEL/CentOS have the old one (system tzdata build with old zic)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: tzdata with-system-tzdata different behavior

Excuse me fot my late answer and thanks your for fast response.
This sounds like a suitable explanation. Now we have do deal with this situation. Maybe we will find a solution for us and other people.

Thanka a lot!