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

Saint Lucia HA reported timestamp / timezone bug #65

Open
kylemtowle opened this issue Apr 20, 2020 · 7 comments
Open

Saint Lucia HA reported timestamp / timezone bug #65

kylemtowle opened this issue Apr 20, 2020 · 7 comments
Assignees

Comments

@kylemtowle
Copy link
Contributor

kylemtowle commented Apr 20, 2020

Saint Lucia reports that the unix timestamps are off by 3 hours from local time when they load the GPS data into the redaction tool.

@kylemtowle
Copy link
Contributor Author

[{"latitude":14.08051832,"longitude":-60.94727734,"time":1587332801000},{"latitude":14.08815485,"longitude":-60.95036579,"time":1587333447000},{"latitude":14.0896572,"longitude":-60.95411059,"time":1587333749000}]

safe_paths_screenshot_for_kyle

@kylemtowle
Copy link
Contributor Author

Hey Kyle;

It was great speaking to you today as well. The error seems to be in the Safe Places Redaction Tool. I have attached a screenshot and the supporting json file. It is off by 3 hrs. I wrote some code to show what it should look like and I have pasted it at the bottom of the screenshot.to show show you what it should say. I was at the location at 6pm yesterday and it shows 3pm. Happy to assist.

Regards
Jim

@mundanelunacy
Copy link
Collaborator

Any chance we can have the file shown in the screenshot above?

@kylemtowle
Copy link
Contributor Author

Not sure which file you are referring to...

@mundanelunacy
Copy link
Collaborator

The json file Jim loaded on the redaction tool

@kylemtowle
Copy link
Contributor Author

How does the MAPS API convert these timestamps to local time zone? The unix timestamps are in GMT and are correct, they just need to be converted to the local time zone. In the example above they look to be converted to PST..

@mundanelunacy
Copy link
Collaborator

mundanelunacy commented Apr 21, 2020

Happens here:
https://github.com/tripleblindmarket/safe-places/blob/develop/js/location-scrubber.js#L266

From this SO article looks like .toLocaleString() is getting Jim's timezone from his system user settings.

Could be that the TZ on Jim's computer is set to PST or he is using a browser flavor that doesn't implement .toLocalString() correctly.

AFIK, there are three ways to get Times to display with the correct Timezone (none of which are great)

  1. Have an on-screen UI element where user selects his TZ
  2. Use a service to reverse GeoCode the IP to infer the TZ (e.g. maxmind)
  3. Display all times in GMT and call it a day

How mission critical is this bug in getting early traction? Option 1 and 2 look like solid requirements for dev_react. Could potentially be time-consuming for MVP

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

No branches or pull requests

2 participants