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

Make the UI display time in local time zone time as well as UTC #2620

Closed
zengzhenbo opened this issue May 30, 2016 · 7 comments
Closed

Make the UI display time in local time zone time as well as UTC #2620

zengzhenbo opened this issue May 30, 2016 · 7 comments

Comments

@zengzhenbo
Copy link

In the file rabbit_mgmt_format.erl
now_to_str(unknown) ->
unknown;
now_to_str(MilliSeconds) ->
BaseDate = calendar:datetime_to_gregorian_seconds({{1970, 1, 1},
{0, 0, 0}}),
Seconds = BaseDate + (MilliSeconds div 1000),
{{Y, M, D}, {H, Min, S}} = calendar:gregorian_seconds_to_datetime(Seconds),
print("~w-~2.2.0w-~2.2.0w ~w:~2.2.0w:~2.2.0w", [Y, M, D, H, Min, S]).

the result of now_to_str/1 is UTC time, and these times will be showed on the management ui, users may misunderstand these time.
now_to_str/1 should converts from UTC to local time by call calendar:universal_time_to_local_time/1 before print/1

@michaelklishin
Copy link
Member

Actually now that I think about it, it only makes sense to convert to a local time in the browser because server's time zone may or may not be local.

@michaelklishin michaelklishin changed the title Format datatime string should converts to local time Consider making the UI display time in local time zone time, not UTC May 30, 2016
@michaelklishin
Copy link
Member

Using UTC time on servers is the only sane thing to do, too.

@zengzhenbo
Copy link
Author

Got it.

@shark555
Copy link

Not so fast ;) There is also a problem with inferring the correct state of queue.
In my case idle_since is 2 hours before the local time so queue is always shown in idle state which is not true. This is very misleading. Fix probably should be made somewhere in javascript.

@michaelklishin michaelklishin changed the title Consider making the UI display time in local time zone time, not UTC Make the UI display time in local time zone time as well as UTC Oct 6, 2016
@chatainsim
Copy link

Any update on this ?

@michaelklishin
Copy link
Member

No updates and no plans to prioritize this any time soon. Community contributions would be considered, this is open source software after all.

@dcorbacho dcorbacho transferred this issue from rabbitmq/rabbitmq-management Nov 17, 2020
@hueifeng
Copy link

This issue can be closed, see #4331

@michaelklishin michaelklishin added this to the 3.10.0 milestone May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants