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

Compatibility with old ICU TZ data #15296

Closed
Yiivgeny opened this issue Dec 5, 2017 · 2 comments
Closed

Compatibility with old ICU TZ data #15296

Yiivgeny opened this issue Dec 5, 2017 · 2 comments

Comments

@Yiivgeny
Copy link

Yiivgeny commented Dec 5, 2017

Problem still in December 2017. Letest CentOS 7, but libicu still same old version and updating still so hard.

Copied from #5128 (comment) (2 year ago)

At first, method formatDateTimeValue is dirty, because use two timezonedb for opposite operation. Time-to-object (with php tzdb), then object-to-string (with icu tzdb)

$DT = new \DateTime;
var_dump($DT->format('c')); //2015-12-17T17:05:02+03:00
var_dump(\Yii::$app->getFormatter()->asDatetime($DT)); //17 дек. 2015 г., 18:05:02

Assume, it's server software problem, but input value already contain TZ info, why not use it for cleanly behavior?

At second, updating timezonedb so hard on some systems, e.g. CentOS 6.x (with all updates and enabled popular update repos) now contain old libicu (Version: 50.1.2 Release Date: 2012-12-17). Updating (http://habrahabr.ru/post/241447/) is not trivial and stable.

I suggest, pass tz-argument for instantiate IntlDateFormatter as offset string (getted from \DateTime object). Result:

  • Narrow updates to only php-related tzdata (more friendly framework installing)
  • For not-updated environments behavior more cleanly (same result for internal and intl conversions)
  • Full BC, in my oppinion.

I can create PR for it.

@samdark samdark added this to the 2.0.16 milestone Dec 5, 2017
@samdark
Copy link
Member

samdark commented Feb 3, 2018

Would be good.

@samdark samdark modified the milestones: 2.0.16, 2.1.1 Feb 3, 2018
@samdark samdark closed this as completed Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants