Weather skill does not account for timezone

I am in the US Central time zone. If it is Friday and I ask ‘MyCroft, what is the weather tomorrow’, I get the following

asking at 5:15 pm - The weather on Saturday is…
asking at 6:15 pm - The weather on Sunday is …

Looks like it is using UTC rather than the local date/time.

If I ask ‘What day is tomorrow’, MyCroft answers correctly at both times. seems to just be with the weather skill.

Thanks so much for reporting this, @tiredoftry.

We’re tracking a couple of location bugs with the front end of mycroft.ai.

I don’t suppose you’d be comfortable sharing your web_config_cache.json file with me?

Not a problem…

{  

“location”:{
“coordinate”:{
“latitude”:35.385924,
“longitude”:-94.398548,
“updated_at”:1517621437151,
“created_at”:1517621437151
},
“created_at”:1517621437097,
“city”:{
“state”:{
“code”:“AR”,
“created_at”:1488997785967,
“updated_at”:1488997785967,
“country”:{
“code”:“RO”,
“created_at”:1486389469824,
“updated_at”:1486389469824,
“name”:“Romania”
},
“name”:“Arad County”
},
“code”:“Fort Smith”,
“created_at”:1517621437098,
“updated_at”:1517621437098,
“name”:“Fort Smith”
},
“updated_at”:1517621437097,
“timezone”:{
“code”:“America/Chicago”,
“offset”:-21600000,
“updated_at”:1486060240386,
“name”:“Central Standard Time”,
“dst_offset”:3600000,
“created_at”:1486060240386
}
},
“stt”:{
“google”:{
“credential”:{
“updated_at”:1526587989620,
“created_at”:1517619829727
},
“updated_at”:1526587989620,
“created_at”:1517619829727
},
“openstt”:{
“credential”:{
“updated_at”:1526587989624,
“created_at”:1517619829724
},
“updated_at”:1526587989623,
“created_at”:1517619829724
},
“ibm”:{
“credential”:{
“updated_at”:1526587989617,
“created_at”:1517619829715
},
“updated_at”:1526587989616,
“created_at”:1517619829715
},
“module”:“mycroft”,
“wit”:{
“credential”:{
“updated_at”:1526587989613,
“created_at”:1517619829718
},
“updated_at”:1526587989612,
“created_at”:1517619829718
},
“mycroft”:{
“credential”:{
“updated_at”:1526587989609,
“created_at”:1517619829721
},
“updated_at”:1526587989608,
“created_at”:1517619829721
}
},
“system_unit”:“imperial”,
“date_format”:“MDY”,
“updated_at”:1526587989605,
“enclosure”:{
“port”:"/dev/ttyAMA0",
“rate”:9600,
“updated_at”:1526587989840,
“timeout”:5.0,
“created_at”:1517619829737
},
“tts”:{
“google”:{
“updated_at”:1526587989632,
“created_at”:1517619829732
},
“mimic”:{
“voice”:“ap”,
“updated_at”:1526587989627,
“created_at”:1517619829734
},
“fatts”:{
“updated_at”:1526587989634,
“created_at”:1517619829730
},
“module”:“google”,
“marytts”:{
“updated_at”:1526587989629,
“created_at”:1517619829733
},
“espeak”:{
“updated_at”:1526587989631,
“created_at”:1517619829731
}
},
“listener”:{
“sample_rate”:16000,
“multiplier”:1.0,
“updated_at”:1526587989837,
“channels”:1,
“threshold”:1e-90,
“energy_ratio”:1.5,
“phonemes”:“HH EY . M AY K R AO F T”,
“wake_word”:“hey mycroft”,
“created_at”:1517619829736
},
“time_format”:“half”,
“skills”:{
“created_at”:1517619829735,
“directory”:"~/.mycroft/skills",
“updated_at”:1526587989835,
“stop_threshold”:2.0
},
“created_at”:1517619829713
}

Just so I’m diagnosing from the right starting point @tiredoftry, is your correct location Fort Smith in Arkansas?

Best, Kathy

Correct, Fort Smith, Arkansas.

1 Like

Additional data point: I just asked Mycroft about tomorrows weather and got a report for Wednesday.

Thanks so much for confirming, @tiredoftry.

I did a bit of digging into this, and I don’t think the timezone is the issue here. In the weather-skill code, when you use a day of the week or relative reference like Monday or tomorrow, this function converts that reference to an actual date.

My read of this is that the code does not take into account the timezone of the user - so if the user is in timezone GMT -0600, then it will treat 5.15pm as 11.15pm - ie tomorrow is Saturday, but will treat 6.15pm as 12.15am - ie tomorrow is Sunday.

This also explains why I get such interesting results - I’m in UTC +1000hrs near Melbourne, Australia. If I ask before 10am in the morning what tomorrow’s weather is like, I get today’s result :wink:

To resolve this I think it will take some re-factoring of the Weather Skill to take into account timezone when calculating relative days.

2 Likes