JulianNorton / weather-10kb-wxkb

Weather forecast that's high performance and accessible
https://wxkb.juliannorton.com
GNU General Public License v2.0
152 stars 49 forks source link

Investigate why updated time does not correspond with local time #113

Closed ghost closed 5 years ago

ghost commented 7 years ago

Issue: In the Now section of the weather report is a short bit of text which reads "(updated: {time})". This text lets the user know when the weather report was generated. Unfortunately, the time only appears to represent Eastern Time instead of the user's local time.

For example, when viewing the weather in San Francisco this morning, the webpage claims that the weather report is from the future: http://ca.mag.cm/3E422I1C061v

Solution: It would be helpful if the updated time displayed on the page was adjusted to correspond with the user's local timezone.

JulianNorton commented 7 years ago

Thanks @charlesmagnuson for reporting, could you tell me if this was the default home URL or a specified location?

e.g. wxkb.io or wxkb.io/san-fran ?

screen shot 2017-01-24 at 2 07 38 pm screen shot 2017-01-24 at 2 07 45 pm

https://github.com/JulianNorton/weather-10kb/blob/development/weather10kb.js#L84 should be setting the correct time.

JulianNorton commented 7 years ago

Not sure if related, but server was on Eastern Time but I've just now switched it to UTC.

Tardog commented 7 years ago

While I’m not the author of the issue, I would like to confirm that changing the server time zone to UTC seems to have fixed the time displayed on the website for me. It now correctly displays my local time, was Eastern before.

ghost commented 7 years ago

Sorry for the slow reply! Just got back from lunch.

It appears the updated time now displays correctly on my end. Thank you very much for looking into the situation. To close the loop on your question, I was viewing wxkb.io directly with no specified location.

JulianNorton commented 7 years ago

Myself and @modelm are having this issue again.

Server time is still correctly UTC. Needs investigation:

JulianNorton commented 7 years ago

I restarted the node process and it seemed to fix it. I'm baffled.

  1. Wrong time.
  2. forever stopall
  3. [secret key pairs… ] forever start index.js
  4. Right time.

error logs:

[Tue Feb 07 12:32:17.606283 2017] [proxy:error] [pid 23369:tid 139764795692800] AH00940: HTTP: disabled connection for (localhost)
[Wed Feb 15 13:29:18.031746 2017] [proxy:error] [pid 6229:tid 139764753729280] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:5000 (localhost) failed
[Wed Feb 15 13:29:18.032087 2017] [proxy:error] [pid 6229:tid 139764753729280] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 0s
[Wed Feb 15 13:29:18.032130 2017] [proxy_http:error] [pid 6229:tid 139764753729280] [client 208.185.185.131:54478] AH01114: HTTP: failed to make connection to backend: localhost
[Wed Feb 15 13:29:18.219333 2017] [proxy:error] [pid 6272:tid 139764636231424] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:5000 (localhost) failed
[Wed Feb 15 13:29:18.219463 2017] [proxy:error] [pid 6272:tid 139764636231424] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 0s
[Wed Feb 15 13:29:18.219482 2017] [proxy_http:error] [pid 6272:tid 139764636231424] [client 208.185.185.131:56999] AH01114: HTTP: failed to make connection to backend: localhost, referer: https://wxkb.io/
[Wed Feb 15 13:29:19.303341 2017] [proxy:error] [pid 6229:tid 139764770514688] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:5000 (localhost) failed
[Wed Feb 15 13:29:19.303369 2017] [proxy:error] [pid 6229:tid 139764770514688] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 0s
[Wed Feb 15 13:29:19.303375 2017] [proxy_http:error] [pid 6229:tid 139764770514688] [client 130.157.41.199:61662] AH01114: HTTP: failed to make connection to backend: localhost, referer: https://wxkb.io/
JulianNorton commented 7 years ago

This issue has re-surfaced.

Restarting the node process didn't resolve the time difference. Error logs didn't seem to provide any additional info.

Tardog commented 7 years ago

Do you still experience this issue? I see the correct local time on both the production site and my local version.

JulianNorton commented 7 years ago

@Tardog It resolved on it's own! What worries me is that I don't know why it happened. Closing for now and hope it was a temporary problem.

JulianNorton commented 7 years ago

Happening again. Restarted node process and upgraded server distribution with no luck.

Mursenary44 commented 5 years ago

This issue (or a similar one) is happening again. Looks like the time is set 6hrs ahead of my current time.

screenshot

JulianNorton commented 5 years ago

@Mursenary44 any recommendations? I tried restarting the service but it didn't fix it.

JulianNorton commented 5 years ago

Doing a server reboot didn't work either.

JulianNorton commented 5 years ago

Still an issue, we think https://github.com/JulianNorton/weather-10kb-wxkb/commit/4493546ce0e4e7d970a2fcd598af67c7b16357ca is the route to solve it. Basically google's timezone API wasn't being set/used.

https://gist.github.com/JulianNorton/5a828b5537f6dc09ed893836586286cd

JulianNorton commented 5 years ago

Thinking about just changing it to "X hours from now". I'll submit a PR on Monday.

JulianNorton commented 5 years ago

@Mursenary44 see https://github.com/JulianNorton/weather-10kb-wxkb/pull/206 !