No.  You always get all available data for a complete day (00:00:00 to 23:59:59 
local time).

So in UTC+10, the first entry in the returned data is   00:00:00 UTC+10  
(14:00:00 UTC the previous day)  and the last entry in the returned data is 
23:59:59 UTC+10  (13:59:59 UTC  same day)
and in UTC-4, the first entry in the returned data is   00:00:00 UTC-4  
(04:00:00 UTC same day)  and the last entry in the returned data is 23:59:59 
UTC-4  (03:59:59 UTC the  next day)

Consider a request for data for 20190520 made in the UTC+10 timezone.
If the request is made at 01:00 on May 31 local time,   (15:00 May 30 UTC), the 
API will return all data for 20190521. ie. Observations made from 00:00 May 21 
to 23:59 May 21 local time.  (14:00 May 20 UTC to 13:59 May 21 UTC)
If the request is made at 11:00 on May 31 local time,   (01:00 May 31 UTC), the 
API will return all data for 20190520. ie. Observations made from 00:00 May 20 
to 23:59 May 20 local time. (14:00 May 19 UTC to 13:59 May 20 UTC)


I think that the same request for data for 20190520 made in the UTC-4 timezone 
has the following behaviour (judging from what I’ve seen reported on this 
thread)
If the request is made at 11:00 on May 30 local time,   (15:00 May 31 UTC), the 
API will return all data for 20190520. ie. Observations made from 00:00 May 20 
to 23:59 May 20 local time. (04:00 May 20 UTC to 03:59 May 21 UTC)
If the request is made at 21:00 on May 30 local time,   (01:00 May 31 UTC), the 
API will return all data for 20190519. ie. Observations made from 00:00 May 19 
to 23:59 May 19 local time (04:00 May 19 UTC to 03:59 May 20 UTC)


So it appears that Weather Underground is doing the following.

1. Determining whether current date at the station is the same as the current 
date UTC.
2. If the two dates are different, adjust the date in the request to “allow 
for” the date difference.
3. Return the data between 00:00 and 23:59 (local time) on the adjusted date.

Step 2 is unwanted and undesirable.


If Weather Underground doesn’t fix this, wunderfixer needs to work out whether 
the local time date is the same as the UTC date. If it is, send the request as 
usual.
If the local time date is currently ahead of the UTC date, adjust the request 
to ask for the day before the date you actually want.
If the local time date is currently behind the UTC date, adjust the request to 
ask for the day after the date you actually want.


Rod







On 31 May 2019, at 3:14 pm, Andrew Milner 
<[email protected]<mailto:[email protected]>> wrote:

..... so does this just simplify to the fact that in the api the date is taken 
as being the UTC date?
ie if one requests data for 20190529, and timezone is +3 you get back data for 
UTC00:00 29 may to 23:59 29 may
which is 03:00 29 may local to 23:59 29 may local AND 00:00 30 may local - 
02:59 30 may local

so to get the data for 29 may local it would be necessary to
1. get data for utc 28 may and discard utc 00:00 - 20:59
2. get data for utc 29 may and discard utc 21:00 - 23:59

or have i not understood correctly?


On Friday, 31 May 2019 05:48:09 UTC+3, Rod Yager wrote:

I constructed a cron job which exectued  wunderdates --date=2019-05-30  twice 
every hour, once 2 minutes before the hour and once 2 minutes after the hour.

Consistent with my earlier post, between 00:00+10 and 09:59+10 the reply from 
the api had data which belonged to 2019-05-31 - the day after the requested 
date. Before midnight, and after 10am local time, the reply from the api had 
data which belonged to 2019-05-30 (as requested).

I've pasted below some representative samples of the last 3 lines of the 
wunderdates output.

Before midnight on May 30: Request is for May 30 data. Replies are May 30 data  
Local Date = UTC date.

Thu May 30 20:58:02 2019 UTC+10
epoch: 1559213100 date_epoch_local: 2019-05-30 20:45:00 utcepoch: 1559212100 
date_epoch_utc: 2019-05-30 10:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T10:45:00Z obsTimeLocal: 2019-05-30 20:45:00
epoch: 1559213400 date_epoch_local: 2019-05-30 20:50:00 utcepoch: 1559212400 
date_epoch_utc: 2019-05-30 10:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T10:50:00Z obsTimeLocal: 2019-05-30 20:50:00
Number of WU records:          251


Thu May 30 22:58:03 2019 UTC+10
epoch: 1559220000 date_epoch_local: 2019-05-30 22:40:00 utcepoch: 1559219000 
date_epoch_utc: 2019-05-30 12:40:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T12:40:00Z obsTimeLocal: 2019-05-30 22:40:00
epoch: 1559220300 date_epoch_local: 2019-05-30 22:45:00 utcepoch: 1559219300 
date_epoch_utc: 2019-05-30 12:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T12:45:00Z obsTimeLocal: 2019-05-30 22:45:00
epoch: 1559220600 date_epoch_local: 2019-05-30 22:50:00 utcepoch: 1559219600 
date_epoch_utc: 2019-05-30 12:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T12:50:00Z obsTimeLocal: 2019-05-30 22:50:00
Number of WU records:          275


Thu May 30 23:58:02 2019 UTC+10
epoch: 1559223900 date_epoch_local: 2019-05-30 23:45:00 utcepoch: 1559222900 
date_epoch_utc: 2019-05-30 13:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:45:00Z obsTimeLocal: 2019-05-30 23:45:00
epoch: 1559224200 date_epoch_local: 2019-05-30 23:50:00 utcepoch: 1559223200 
date_epoch_utc: 2019-05-30 13:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:50:00Z obsTimeLocal: 2019-05-30 23:50:00
Number of WU records:          287


10 hour period after midnight on May 31. Request is for May 30 data. Replies 
are May 31 data.  Local Date is 1 day ahead of UTC date

Fri May 31 00:02:02 2019 UTC+10
Could not get Weather Underground data.
Reason: No JSON object could be decoded
Could not get Weather Underground data. Exiting.


Fri May 31 00:58:02 2019  UTC+10
epoch: 1559227500 date_epoch_local: 2019-05-31 00:45:00 utcepoch: 1559226500 
date_epoch_utc: 2019-05-30 14:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T14:45:00Z obsTimeLocal: 2019-05-31 00:45:00
epoch: 1559227800 date_epoch_local: 2019-05-31 00:50:00 utcepoch: 1559226800 
date_epoch_utc: 2019-05-30 14:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T14:50:00Z obsTimeLocal: 2019-05-31 00:50:00
Number of WU records:          11


Fri May 31 02:58:03 2019 UTC+10
epoch: 1559234700 date_epoch_local: 2019-05-31 02:45:00 utcepoch: 1559233700 
date_epoch_utc: 2019-05-30 16:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T16:45:00Z obsTimeLocal: 2019-05-31 02:45:00
epoch: 1559235000 date_epoch_local: 2019-05-31 02:50:00 utcepoch: 1559234000 
date_epoch_utc: 2019-05-30 16:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T16:50:00Z obsTimeLocal: 2019-05-31 02:50:00
Number of WU records:          35


Fri May 31 05:58:02 2019 UTC+10
epoch: 1559245500 date_epoch_local: 2019-05-31 05:45:00 utcepoch: 1559244500 
date_epoch_utc: 2019-05-30 19:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T19:45:00Z obsTimeLocal: 2019-05-31 05:45:00
epoch: 1559245800 date_epoch_local: 2019-05-31 05:50:00 utcepoch: 1559244800 
date_epoch_utc: 2019-05-30 19:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T19:50:00Z obsTimeLocal: 2019-05-31 05:50:00
Number of WU records:          71


Fri May 31 08:58:03 2019 UTC+10
epoch: 1559256300 date_epoch_local: 2019-05-31 08:45:00 utcepoch: 1559255300 
date_epoch_utc: 2019-05-30 22:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T22:45:00Z obsTimeLocal: 2019-05-31 08:45:00
epoch: 1559256600 date_epoch_local: 2019-05-31 08:50:00 utcepoch: 1559255600 
date_epoch_utc: 2019-05-30 22:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T22:50:00Z obsTimeLocal: 2019-05-31 08:50:00
Number of WU records:          107


Fri May 31 09:58:03 2019 UTC+10
epoch: 1559259900 date_epoch_local: 2019-05-31 09:45:00 utcepoch: 1559258900 
date_epoch_utc: 2019-05-30 23:45:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T23:45:00Z obsTimeLocal: 2019-05-31 09:45:00
epoch: 1559260200 date_epoch_local: 2019-05-31 09:50:00 utcepoch: 1559259200 
date_epoch_utc: 2019-05-30 23:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T23:50:00Z obsTimeLocal: 2019-05-31 09:50:00
Number of WU records:          119

After 10AM on May 31: Request is for May 30 data. Replies are May 30 data  
Local Date = UTC date.

Fri May 31 10:02:02 2019 UTC+10
epoch: 1559224200 date_epoch_local: 2019-05-30 23:50:00 utcepoch: 1559223200 
date_epoch_utc: 2019-05-30 13:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:50:00Z obsTimeLocal: 2019-05-30 23:50:00
epoch: 1559224500 date_epoch_local: 2019-05-30 23:55:00 utcepoch: 1559223500 
date_epoch_utc: 2019-05-30 13:55:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:55:00Z obsTimeLocal: 2019-05-30 23:55:00
Number of WU records:          288

Fri May 31 11:02:02 2019 UTC+10
epoch: 1559224200 date_epoch_local: 2019-05-30 23:50:00 utcepoch: 1559223200 
date_epoch_utc: 2019-05-30 13:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:50:00Z obsTimeLocal: 2019-05-30 23:50:00
epoch: 1559224500 date_epoch_local: 2019-05-30 23:55:00 utcepoch: 1559223500 
date_epoch_utc: 2019-05-30 13:55:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:55:00Z obsTimeLocal: 2019-05-30 23:55:00
Number of WU records:          288

Fri May 31 12:02:03 2019 UTC+10
epoch: 1559224200 date_epoch_local: 2019-05-30 23:50:00 utcepoch: 1559223200 
date_epoch_utc: 2019-05-30 13:50:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:50:00Z obsTimeLocal: 2019-05-30 23:50:00
epoch: 1559224500 date_epoch_local: 2019-05-30 23:55:00 utcepoch: 1559223500 
date_epoch_utc: 2019-05-30 13:55:00 tz: Australia/Sydney obsTimeUtc: 
2019-05-30T13:55:00Z obsTimeLocal: 2019-05-30 23:55:00
Number of WU records:          288


I think this is enough to describe definitively what happens in UTC+X timezones.

Rod





--
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5a44cbcd-8ddd-4a11-a2d0-4fc8cd4d0663%40googlegroups.com<https://groups.google.com/d/msgid/weewx-user/5a44cbcd-8ddd-4a11-a2d0-4fc8cd4d0663%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/74623B93-A823-4BF8-B5E5-8A2D77158294%40yager.net.au.
For more options, visit https://groups.google.com/d/optout.

Reply via email to