Api to get user's timezone

Hi, I’m trying to use amazon api to get user’s timezone but when I test it I get the error “src property must be a valid json object”. Any help?

Thanks

it works only on ADC or echo devices, not works on voiceflow’s prototyping.

It’s not working in adc :confused: do you now a simple way to get user’s timezone? I did the tutorial but it keeps not working.

I think no. Timezone can be done by device settings API only.

BTW, you just copied and pasted some codes from tutorial? This forum might change some characters, such as single and double quote, in code so that it might not work in Voiceflow. Here’s right code.

if(userTimezone == 0){ userTimezone = "America/New_York"};

theTime = new Date().toLocaleTimeString(locale, { hour: '2-digit', minute: '2-digit', timeZone: userTimezone});
theDate = new Date().toLocaleDateString(locale, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', timeZone: userTimezone});

works in my end.

This is my flow.

From that tutorial, I added some error handlings so that I could find where error happened. also, I usually use Card Block to get a value of a variable as debug.

s 372

It worked! I was the copy paste problem. Thanks a lot.