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

Time zone abbreviation names are buggy #3160

Open
mostafa-rz opened this issue Mar 10, 2025 · 0 comments
Open

Time zone abbreviation names are buggy #3160

mostafa-rz opened this issue Mar 10, 2025 · 0 comments

Comments

@mostafa-rz
Copy link

mostafa-rz commented Mar 10, 2025

Hi,
I tried to use getAbbreviatedName(), but it returned the wrong result. If I use the PHP timezones I will get the correct one.

// Carbon, result amt
Carbon\CarbonTimeZone::create('Europe/Athens')->getAbbreviatedName()


// PHP, result EET
$timezone = new DateTimeZone('Europe/Athens');
$dateTime = new DateTime('now', $timezone);
$abbreviation = $dateTime->format('T');

I also did some debugging, and it seems that in this line, the array returned by the $this->listAbbreviations() could contain more than one 'Europe/Athens' in different abbreviations.

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

No branches or pull requests

1 participant