apetitjean / EZLog

A very easy and pragmatic log module for admins in a hurry.
49 stars 12 forks source link

Support for TimeZone #3

Open lazywinadmin opened 8 years ago

lazywinadmin commented 8 years ago

Great module Arnaud!

Would it be possible to add support for TimeZone OR Set the time to UTC/GMT by default. This becomes very helpful when you compare logs coming from different machines located in different parts of the world.

Let me know your thoughts.

I was thinking to contribute to your module initially but I'm not sure if this will break the current usages that users are making of it.

apetitjean commented 8 years ago

Thanks FX!

That's a good suggestion. I'll definitely address this need. Don't hesitate to send a pull request if you want to contribute, your contributions are welcome!

apetitjean commented 8 years ago

It could be implemented as a switch passed with the header. I'm thinking of a switch like "-UTC". What do you think about it?

lazywinadmin commented 8 years ago

That could be one solution however you won't know which parameter was used when looking at the log.

So I'm thinking, this should be included in the metadata of the log. This way, if you ever need to parse multiple logs you can pre-check all the logs use the same timezone. What do you think ?

I'll propose something in a PR, feel free to comment/reject.

apetitjean commented 7 years ago

This is the next item on my to list. ;-) I will - as you suggested - update the metadata section to add this info. This way it will be easily understandable by ConvertFrom-EzLog.

nrml13 commented 1 week ago

Hi ! +1 for the timezone support.

Could be done by replacing this : Get-Date -UFormat "%Y-%m-%d %H:%M:%S" By this : Get-Date -Format O

It give the following date for example : 2024-11-19T11:31:54.3015322+01:00 So it add timezone and millisecs.

Another option would be to add a parameter for the date format to enable customization.