5
我正在尝试开发一个Alexa技能,我需要获取相对时间,例如:“5分钟前”。在Alexa中获取相对时间
我为我的技能定义了一个时间段,接受时间如5 minutes
,6.30 am
或4 in the morning
。但我无法接受像5 minutes ago
这样的时间。我新Alexa的,可以有一个人帮我这个
{
"slots": [
{
"name": "time",
"type": "AMAZON.TIME"
}
],
"intent": "ReportTime"
}
下面@Connum回答是一个很好的开始。请注意,除非您要求邮政编码信息并且可以自行处理,否则您可能会遇到与时区相关的问题,请参阅以下主题:https://stackoverflow.com/questions/44072625/how-do-i-get-a-users- date-time-or-timezone-information-for-an-alexa-skill –