Provide device timezone in Alexa requests
I have created a skill that manages daily routines. When invoked, the skill needs to calculate If a user completed a task on the same day.
As of now, I'm guessing the timezone by the locale, but this is far from exact.
Asking for the postal code permission is a deal breaker.
I'm sure there are a lot of other skills that also would benefit from knowing the timezone.
We are happy to inform you that the feature you have requested has launched! Please refer to the following page(s) for more information:
I'd really like to be able to express times to customers in their local timezones. Right now both of my timezone-dependent skills are getting a lot of negative reviews from customers who have not set their device address (I think they assume their Amazon address automatically propagates) and as a result my skill cannot tell them information that is dependent on timezones.
Beyond that, I have to use an external API to link every zip code with a timezone and I often struggle to support users in new regions (India, Europe, etc.) because those postcodes are not supported by most APIs for this purpose. It's a huge hassle for skills that help users make choices based on the time of day.
+1. This enables so much good functionality for 3rd party devs.
Jimbo Gilmour commented
using SDK 2.0
In the process will teach how to use
Device Address API Integration
with your own consent code where default is set in the API call
Anand Dev Singh commented
Still, there is no direct support from Alexa to return date and time based on the device's address. But this sounds like a cool feature.
It will help the developers to take the appropriate decisions related to the device's date and time. Like greeting Good Morning, Evening etc.
PAVEL FILIPPOV commented
Assuming that you provide the account linking for your Alexa skill.
You can get the user's time zone from the browser during the linking process using one of these:
2. MomentJS (https://momentjs.com/timezone/docs/)
Once you got the time zone keep it in you database, S3 bucket,...
It is up to you then to decide how to link the user id with his time zone.
I run into this issue when I was thinking about to greet the user appropriate. Without timezone information this can become ridiculous. I do not care for the country, zip code or the address. IMHO this is not a very sensitive information. I counted it a while ago my timezone: it is used in about 20 countries.
Jake Stanley commented
Same here. Unfortunately, I'm having to grab the user's postal code and use a Google API to convert to a timezone. Seems like the timezone is less invasive than postal code. It would be nice to see this ability released soon.
Mark Tucker commented
For even the very basic use case of having the skill greet the user with a good morning/afternoon/evening you need to know the timezone of the user. But this is not available today.
The solution can either be as simple an offset in minutes from UTC or it can be the IANA-specified zones string identifiers like "America/New_York" or "Asia/Tokyo". If there is a concern that even giving the timezone of the user away is too much then just go for offset in minutes.
Make sure that Daylight Savings Time is supported where it is practiced and also where it is not (go Arizona).