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

Changing Timezone setting doesn't affect most time presentation #1057

Closed
philrz opened this issue Sep 7, 2020 · 6 comments · Fixed by #3139
Closed

Changing Timezone setting doesn't affect most time presentation #1057

philrz opened this issue Sep 7, 2020 · 6 comments · Fixed by #3139
Assignees
Labels
bug Something isn't working community

Comments

@philrz
Copy link
Contributor

philrz commented Sep 7, 2020

A community user pointed out:

if I config the setting of timezone,the time in the graph bar of bottom is not changed.

Indeed this is true. As of Brim commit 76f506a talking to zqd commit 42103ef, here's what the UI looks like after importing a test wrccdc pcap:

image

If I change the Timezone Preference from its UTC default to US/Pacific, we can see the values in the ts column change, but the X-axis does not.

image

@philrz philrz added the bug Something isn't working label Sep 7, 2020
@philrz
Copy link
Contributor Author

philrz commented Mar 16, 2021

A community user recently bumped into this (#1507). In their own words:


Describe the bug
Graph Timestamp does not match PCAP timestamps nor System TZ

To Reproduce
My system time is US/Pacific, while the .pcap is US/Eastern; PCAP time is correct; Range selector is correct; Graph time appears to stay at UTC.

Expected behavior
Graph timestamps should match PCAP timestamps.


@philrz philrz changed the title Changing Timezone Preference setting does not affect histogram X-axis Changing Timezone setting doesn't affect most time presentation Dec 26, 2023
@philrz
Copy link
Contributor Author

philrz commented Dec 26, 2023

Another community user recently bumped into this problem by opening issue #2946. In their own words:

Describe the bug
I'm trying to import a JSONL file with RFC 3339 string key with timezone and use the time method to force the conversion to UTC time. But I realized that the time on the timeline is not displayed according to the time zone set by ZUI.
Expected behavior
The time on the timeline should be displayed using the set time zone. It would be nice if the time in the data table also had a time zone.

@philrz
Copy link
Contributor Author

philrz commented Dec 26, 2023

In the history of the Zui/Brim app the timezone support has always been somewhat spotty. However, we've come far enough with the Zed data model and Zui's sophistication that I suspect we could do something soon to address this. Below is a summary of the history, current state of things, and what I think we might do.

This issue was originally opened when the app was still known as "Brim" and the main (only?) place where the timezone support seemed to be incomplete was with the X-axis of the stacked bar chart. The X-axis is still this way in current Zui. However, things have actually gotten a little worse. In the "Brim" days, the time values in the data table that presents query output took the timezone setting into account, but as part of the changes in #2626 that landed shortly before Zui v1.0.0 was released, the time values in the data table also started being presented in UTC similar to if the values had been presented as ZSON output via zed query -z.

As a result, where things stand as of GA Zui v1.0.0 is that there's one place I know of that still changes the time presentation based on the Timezone setting: The Detail panel/window (albeit without the actual inclusion of the timezone/offset and some of the decimal precision dropped, so, even this is somewhat broken). So for example, before taking this screenshot, I've changed my Timezone setting to US/Pacific, and you can see the difference in how it's presented in the two locations.

image

The fact that the Detail panel is able to render it this way implies it may not be too difficult to do the same presentation-layer adjustments in the data table, the X-axis of the stacked bar chart, and the time pins.

Furthermore, Zed's time literals support timezone offsets. That means I can enter the time in Zed queries using my local timezone and the backend will make the appropriate conversion. So for instance, finding the same event as I showed above using a Zed time literal in Pacific time:

image

What this tells me is that we could also have things like the right-click New Search With Value create the Zed time literals in the editor using the offset notation.

Putting that all together, I think this would give the user the seamless experience of working in an alternate timezone while the Zed backend continues to store and consider all time values as 64-bit integer as nanoseconds from epoch.

@philrz
Copy link
Contributor Author

philrz commented Aug 13, 2024

Due to the changes in #3127, the previous rendering of the Detail pane that adjusted time values to reflect the timezone setting has been replaced with the same "Inspector"-style view as the main results output starting with GA Zui release v1.17.0. This means that the Timezone setting at this point is pretty much a no-op. Given that users continue to ask for this functionality (brimdata/brimcap#352 being the most recent), it seems we could stand to boost priority and fix this soon.

@philrz
Copy link
Contributor Author

philrz commented Aug 17, 2024

Note to self: When #3139 is merged and this functionality is verified, follow up with user @nnmmaaoo from brimdata/brimcap#352 to see if they're interested in testing this out in a Zui Insiders release.

@philrz
Copy link
Contributor Author

philrz commented Aug 21, 2024

Verified with Zui Insiders 1.17.1-insiders.12 which is based on Zui commit 2a2e793.

As shown in the attached video, in the Settings menu the Timezone setting actually has effect in the app again, and the Time Format setting has been switched to using strftime formatting directives. When these settings are at their defaults, the app displays the untouched ZSON rendering of time values which is RFC3339 ending in Z indicating UTC (aka RFC3339Nano). If the Timezone setting is changed, the app begins rendering the timestamps in the Inspector/Table/Detail views with the strftime format %Y-%m-%dT%H:%M:%S.%L%:z that shows the offset, and this is a format that the ZSON parser accepts (i.e., such a value-with-offset can be pasted into a program as a time literal). If the Time Format setting is changed to some other strftime string, the timestamps are rendered with that instead.

Verify.mp4

The X axis of the stacked bar chart does not yet change with the timezone setting. A new issue #3141 has been opened to track addressing that in the future.

Thanks @jameskerr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants