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

Allow user to work in timezones besides UTC #3

Open
thodson-usgs opened this issue May 10, 2019 · 6 comments
Open

Allow user to work in timezones besides UTC #3

thodson-usgs opened this issue May 10, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@thodson-usgs
Copy link
Collaborator

All data is converted to UTC; however, some users might prefer to work in a local timezone.

@jjkennedy
Copy link

Is it possible to only pull the date column from groundwater levels? I'm finding that some sites do not have a time associated with the measurement and it's throwing an error because it can't convert that to a datetime index.

@elbeejay
Copy link
Contributor

To update the status of this issue:

At this time there is still no built-in functionality for getting queries back in whatever timezone you want, they do come back with UTC-localized timestamps.

@mishranurag
Copy link

I assume that the daily data is in local time zone. However, the label on the time has Z on it which can be confusing.

image

@thodson-usgs thodson-usgs added the bug Something isn't working label Jul 26, 2023
@thodson-usgs
Copy link
Collaborator Author

thodson-usgs commented Jul 26, 2023

That's a bug alright.
The REST API can accept time zones, so perhaps we could handle this better.
https://waterservices.usgs.gov/rest/IV-Service.html
Unsure what users will want as the default behavior in this case. I vote for UTC as default, otherwise there could be unexpected consequences. Having no default would leave the data in multiple time zones, which isn't ideal. Neither can we assume a default time zone based on the compute clock, because the user may be in a different time zone from their compute.

@wzell-usgs
Copy link

On the subject of UTC - Is it expected behavior that the returned datetime index is UTC +0 rather than local UTC? E.g., for a randomly selected GW site with IV service, here is the dataRetrieval result (UTC+0):

dataRetrieval

and here is the NWIS web interface 'view data' (UTC-6):

webdata

I think can programmatically convert to local UTC using the tz_cd with the site information but perhaps it is preferred to have dataRetrieval handle that conversion?

@thodson-usgs
Copy link
Collaborator Author

Correct, we decided to stick with USGS, unlike the web interface. The reason being what is "local time" when you're working analyzing data from multiple timezones?

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

No branches or pull requests

5 participants