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 –