Skip to content

Local time for UTC timestamps #1016

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

Closed
enkelmedia opened this issue Jun 4, 2021 · 10 comments
Closed

Local time for UTC timestamps #1016

enkelmedia opened this issue Jun 4, 2021 · 10 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@enkelmedia
Copy link

Question

I have a question around dates as in this issue, #154 but in my case the timestamps in the log files is UTC-time (using Serilog), is there a way to adjust the "Date"-column to show the local time based on the UTC-stamp?

If not I would be open to contribute with some kind of setting if that would be something that you would like to add.

@enkelmedia enkelmedia added the question Further information is requested label Jun 4, 2021
@LiorBanai
Copy link
Member

Yeah I think checkbox specifying if it is utc or not or option to add offset will be beneficial to the users.

@enkelmedia
Copy link
Author

enkelmedia commented Jun 4, 2021

Sweet! Question is where to put this? As I guess it is not a ”general setting” as some logs might be utc and others is in local time. So its a ”per log file” setting I guess?

What do you think? Where should this be placed?

@LiorBanai
Copy link
Member

You raise a very good question and I actually need to give this a thought.. it is possible that we may need to expand the Analogy.Interface assembly to get to datetime specification from the data provider (serliog, nlog, etc).. But my guess is that most people are using single log format so in theory the new settings could be at at application level settings and not per provider..

need to think about it :)

@LiorBanai LiorBanai added the enhancement New feature or request label Jun 11, 2021
@LiorBanai
Copy link
Member

I think offset control will be the best. It gives the most flexibility to the end user to change the messages:
image

@enkelmedia
Copy link
Author

enkelmedia commented Jun 17, 2021

Thanks for keeping this one alive.

It sounds like a good idea, I just have one question or doubt around this and that would be if one looks at different types of logs, let’s say that some already are in local time, others in UTC - have to jump back and fourth to the settings might not be the best experience.

But on the flip side I don’t really have a great alternative idea, maybe what you proposed in the beginning having a checkbox or “toggle” in the ribbon to quickly switch between the “modes”, or maybe in the statusbar.. who knows? :)

But, at the end of the day - a general setting is a lot better than nothing.

Let me know if and how I can help?

@LiorBanai
Copy link
Member

Well many logs are indeed UTC so there is a benefit to have direct option to switch between utc and local time.

@enkelmedia
Copy link
Author

Sounds very nice!

Where could we put this?

@LiorBanai
Copy link
Member

I think an option per file loaded is the best:
image

@LiorBanai
Copy link
Member

I have released a version with the offsets added:
https://github.com/Analogy-LogViewer/Analogy.LogViewer/releases/tag/V4.7.2

you can find it under the gear icon:
image

@enkelmedia
Copy link
Author

Works like a charm on the .NET 5-version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants