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

Timezone not displayed correctly #24

Closed
soerenbe opened this issue Aug 16, 2017 · 5 comments
Closed

Timezone not displayed correctly #24

soerenbe opened this issue Aug 16, 2017 · 5 comments
Labels

Comments

@soerenbe
Copy link

I have an issue with the display of the report time. See the Screenshot attached. I think this is a timezone issue. The time in the report detail is correct (Screenshot 1), but at the summary site there are always displayed as "in 2 hours".

$ ls -l /etc/localtime
lrwxrwxrwx 1 root root 33 Apr 12 10:38 /etc/localtime -> /usr/share/zoneinfo/Europe/Berlin

Berlin is 2 hours off. So I think this is where those 2 hours come from.

I also see in the report

  logs:
    - !ruby/object:Puppet::Util::Log
      level: !ruby/sym notice
      tags:
        - notice
      message: "Finished catalog run in 7.91 seconds"
      source: Puppet
      time: 2017-08-16 12:53:58.519986 +02:00

This could also be an configuration error. But I can not think about any setting to fix this.

t1

image

@skx
Copy link
Owner

skx commented Aug 16, 2017

Thanks, I've spotted this too but not yet dug into it. We use the javascript library here to convert from absolute to relative time:

That does have some timezone support, which I think we're not using correctly. I guess we could get the timezone from the browser via:

 var offset = new Date().getTimezoneOffset();

I'd need to work out how to use that usefully though.

@skx skx added the bug label Aug 16, 2017
@skx
Copy link
Owner

skx commented Aug 16, 2017

If you hover your mouse over the section that says "in 2 hours" does that show the correct time?

If so it might be that the quickest fix here is just to show absolute times after all, for the moment.

@soerenbe
Copy link
Author

I tried all 4 views (All/Failed/Changed/Unchanged). There is no popup or tooltip, when I hover over the 'in 2 hours'. I have tested it on Chromium and Firefox.

@skx
Copy link
Owner

skx commented Aug 17, 2017

Thanks for the update. That is odd, I certainly see them on my install, although they are a little slow to appear.

Having looked at this again last night I think we throw away the timezone information when the report is parsed - leading to a date/time only - which makes showing these correctly almost impossible. For the next release I'll show absolute time only, and the look at getting it to work properly after that.

@soerenbe
Copy link
Author

That's really odd. I see them on your installation. I checked the HTML code of my installation. The timestamp there is also wrong.

Current Time: 13:11;
Report of $host which ran at 2017-08-17 12:53:40

At the summary page:

<td class="time" datetime="2017-08-17 14:53:40"><span>in 2 hours</span></td>

Thanks to for having a look at that. I will wait for a new release. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants