Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextTransformerTest fails west side of GMT #138

Open
gregor-tb opened this issue Nov 30, 2017 · 2 comments
Open

TextTransformerTest fails west side of GMT #138

gregor-tb opened this issue Nov 30, 2017 · 2 comments
Labels

Comments

@gregor-tb
Copy link

gregor-tb commented Nov 30, 2017

Hi,

actually the last test does not pass here, because of timezone issues:

     'FREQ=YEARLY;BYMONTH=3;UNTIL=20121231T235959Z',
     'yearly on March 16 until December 31, 2012'

For me in Europe/Berlin it results in

    -'yearly on March 16 until December 31, 2012'
    +'yearly on March 16 until January 1, 2013'

what makes sense, I think the code is correct, UTC midnight is 1:59 on january 1st on local. For each location east side of GMT the test passes (including America).

The test should force UTC timezone/starttime and maybe write another test for +/- timezones?

Best regards
Gregor

@gregor-tb
Copy link
Author

OK forcing UTC will not help here, because the issue is in the translation files:

return date('j. ', $params['date']) . $months[date('n', $params['date']) - 1] . date(', Y', $params['date']);

this uses default timezone.

@simshaun simshaun added the bug label Sep 20, 2018
@raneomik
Copy link

raneomik commented Feb 8, 2019

Hi, same here in France (Europe/Paris) - I think it is because of the "UNTIL" datetime value >here< : the "Z" at the end seems to actually specify/force the timezone to UTC, then to adapt the entered until datetime to our timezone (+1 hour in wintertime, +2 in summertime for Europe/Paris).
I tested with "+01" instead of the "Z", and without this "Z" - both passed the tests, and the second case seems to take the current timezone for the actually entered until value.

Same forced then adapted datetime in "UNTIL" occures >here<, but because it is in the middle of the year and the hour is not checked (by the way, is it possible in the transformed text ?), this test passes.

Best regards

EDIT : the test can also be easily fixed by adding the following to the phpunit.xml file > phpunit element :

    <php>
        <ini name="date.timezone" value="UTC" />
    </php>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants