Skip to content

Document that readNWISuv(startDate, EndDate) query dates are in the station's local time zone.

Created by: drf5n

Something is a bit confusing here:

> d = readNWISuv('01670080','62620',startDate='2015-03-19',endDate='2015-03-19')
> head(d)
  agency_cd  site_no            dateTime tz_cd X_62620_00011_cd X_62620_00011
1      USGS 01670080 2015-03-19 04:00:00   EDT                P         -0.86
2      USGS 01670080 2015-03-19 04:06:00   EDT                P         -0.95
3      USGS 01670080 2015-03-19 04:12:00   EDT                P         -1.03
4      USGS 01670080 2015-03-19 04:18:00   EDT                P         -1.10
5      USGS 01670080 2015-03-19 04:24:00   EDT                P         -1.19
6      USGS 01670080 2015-03-19 04:30:00   EDT                P         -1.29
> format(d$dateTime[2],usetz=TRUE)
[1] "2015-03-19 04:06:00 UTC"
> format(d$dateTime[2],tz='America/New_York',usetz=TRUE)
[1] "2015-03-19 00:06:00 EDT"

From the printout It appears to be doing the request for a GMT-bounded day, but the timestamps on the actual data appear to be for for a local-standard-time bounded day. If it is the latter, then this printout is a bit misleading. Since the time data seems to be translated into UTC, maybe the data returned shouldn't have the timezone column.

In the '?readNWISuv' help, it might be nice to highlight that the startDate and endDate are in the station local-standard time, not the date ranges indicated in http://waterservices.usgs.gov/rest/IV-Service.html#Specifying

For reference: > time2=as.POSIXct(360, origin = "2015-03-19", tz = "GMT") > format(time2,tz='GMT',usetz=TRUE) [1] "2015-03-19 00:06:00 GMT" > format(time2,tz='America/New_York',usetz=TRUE) [1] "2015-03-18 20:06:00 EDT"

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information