mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[GH-ISSUE #832] DateTimeImmutable ignores timezones when useMicrosecondTimestamps() is set #322
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#322
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dhm80 on GitHub (Aug 3, 2016).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/832
If I set a timezone to "non UTC" and enable using microseconds the timezone is completely ignored:
The problem it this part here I think:
github.com/Seldaek/monolog@cc1fe9fa91/src/Monolog/DateTimeImmutable.php (L27-L33)Only if I set something like this as well the correct time would be logged:
But that can't be the solution as I would overwrite global settings and may want the logger to have it's only timezone... that's what the parameter / method is for, right? ;)
@Seldaek commented on GitHub (Sep 18, 2016):
I tried to fix this in #853 - which works if your default timezone is UTC, but otherwise it fails, at least for CET.. for Europe/Zurich for example it works, but I don't get why. Don't have time to dig further right now.
@Seldaek commented on GitHub (Sep 19, 2016):
OK I found a way using an intermediate datetime object, it's not pretty but works.