[GH-ISSUE #196] No timezone support in NormalizerFormatter #66

Closed
opened 2026-03-04 02:11:50 +03:00 by kerem · 7 comments
Owner

Originally created by @jeromer on GitHub (May 21, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/196

Hello,

It seems the default date format available for log lines is very trivial : "Y-m-d H:i:s". source
This formats lacks informations such as current timezone and is not really a standard format.

Would it be a problem to replace this default format by at least something which does not lack information such as RFC 3339 or ISO 8601 date formats ?

Since PHP seems to provide constants such as DateTime::ISO8601 or DateTime::RFC3339 that should not require a lot of work.

If ever I overlooked anything about datetime support in Monolog feel free to tell me :)

Originally created by @jeromer on GitHub (May 21, 2013). Original GitHub issue: https://github.com/Seldaek/monolog/issues/196 Hello, It seems the default date format available for log lines is very trivial : "Y-m-d H:i:s". [source](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/NormalizerFormatter.php#L21) This formats lacks informations such as current timezone and is not really a standard format. Would it be a problem to replace this default format by at least something which does not lack information such as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) or [ISO 8601](http://www.w3.org/TR/NOTE-datetime) date formats ? Since PHP seems to provide constants such as DateTime::ISO8601 or DateTime::RFC3339 that should not require a lot of work. If ever I overlooked anything about datetime support in Monolog feel free to tell me :)
kerem closed this issue 2026-03-04 02:11:50 +03:00
Author
Owner

@staabm commented on GitHub (May 21, 2013):

You may define any format you like using the constructor?
https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/NormalizerFormatter.php#L28

<!-- gh-comment-id:18213205 --> @staabm commented on GitHub (May 21, 2013): You may define any format you like using the constructor? https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/NormalizerFormatter.php#L28
Author
Owner

@jeromer commented on GitHub (May 21, 2013):

That's true but it does not change the problematic.
I was talking about the default format.

:)

<!-- gh-comment-id:18213345 --> @jeromer commented on GitHub (May 21, 2013): That's true but it does not change the problematic. I was talking about the **default** format. :)
Author
Owner

@unwiredbrain commented on GitHub (May 21, 2013):

Generally speaking, I'd agree with @jeromer, but I also think that there could be specific reasons why the current implementation of NormalizerFormatter uses that particular format.

That being said my question is: are there any valid reasons to prefer the current Y-m-d H:i:s format instead of the RFC 3339 one as default?

<!-- gh-comment-id:18220135 --> @unwiredbrain commented on GitHub (May 21, 2013): Generally speaking, I'd agree with @jeromer, but I also think that there could be specific reasons why the current implementation of `NormalizerFormatter` uses that particular format. That being said my question is: are there any valid reasons to prefer the current `Y-m-d H:i:s` format instead of the [RFC 3339](http://tools.ietf.org/html/rfc3339) one as default?
Author
Owner

@Seldaek commented on GitHub (May 21, 2013):

I'm definitely +1 on this. However I think it might be best to delay this for a 2.0 release with other minor breaks that might be needed to clean things up a bit.

<!-- gh-comment-id:18224724 --> @Seldaek commented on GitHub (May 21, 2013): I'm definitely +1 on this. However I think it might be best to delay this for a 2.0 release with other minor breaks that might be needed to clean things up a bit.
Author
Owner

@jeromer commented on GitHub (May 22, 2013):

Do you have any ETA for a 2.0 version ?

Thanks :)

<!-- gh-comment-id:18265715 --> @jeromer commented on GitHub (May 22, 2013): Do you have any ETA for a 2.0 version ? Thanks :)
Author
Owner

@Seldaek commented on GitHub (May 22, 2013):

When it's done. It's not much work though, I don't feel like many things need to change.

<!-- gh-comment-id:18266458 --> @Seldaek commented on GitHub (May 22, 2013): When it's done. It's not much work though, I don't feel like many things need to change.
Author
Owner

@jeromer commented on GitHub (May 22, 2013):

ok :)

<!-- gh-comment-id:18267288 --> @jeromer commented on GitHub (May 22, 2013): ok :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#66
No description provided.