It is currently March 28th, 2024, 4:31 pm

PSA: weather.com forecast dates

General topics related to Rainmeter.
Post Reply
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

PSA: weather.com forecast dates

Post by SilverAzide »

Hello all,
This is just a public service announcement for any weather skin authors who use weather.com and have skins that show forecasts (more than just current conditions). It seems that forecast dates in the XML data are unreliable, due to them being offset to UTC time (or something similar).

Here is an example. As I write this, it is Friday February 23, 2018 (US). If I view the XML data for a location where it already Saturday, I get this XML from weather.com. This is for Japan:

Code: Select all

<cc>
    <lsup>2/24/18 12:30 AM JST</lsup>      <-- local time at this observation station; notice it is Saturday 2/24 here
    <obst>Tokyo/Haneda, 13, JA</obst>
    ...
<dayf>
    <lsup>2/23/18 7:00 AM JST</lsup>       <-- this is wrong for this location, this is the previous day
    <day d="0" t="Saturday" dt="Feb 23">   <-- the "Saturday" is correct but the date is wrong; "Feb 23" is Friday
    ...
    <day d="1" t="Sunday" dt="Feb 24">     <-- again "Sunday" is correct, but "Feb 24" is not.
    ...
The forecast ("dayf") node's "lsup" (last update) value appears to be the wrong date with the correct timezone. This behavior appears to apply regardless of the locale, and appears to happen whenever the location you are monitoring is on a day that is different than the day at the UTC location.

The lesson seems to be that if your skin shows the forecast date, do not use the "dt" value (or the "lsup" value) to determine the date, instead use the current condition "lsup" timestamp and increment the days yourself.
Post Reply