Nice of you to share your code Andre. Alternatively, you can use dateutil to parse the ISO datetime format.
import dateutil.parser
Class ActionGetDate(Action):
def name(self):
return 'custom_act_get_date' #****This is used in the story!****
def run(self, dispatcher, tracker, domain):
dictData = next((e for e in tracker.latest_message.entities if
e['entity'] == 'time'), None)
date = dictData['value']
datetime_obj = dateutil.parser.parse(date)
humanDate = datetime_obj.strftime('%Y-%m-%d %H:%M:%S')
time = datetime_obj.time()
#dispatcher.utter_message("I got this time: " + time + ". This is the full date: " + humanDate)
return [SlotSet("slot_time", datetime_obj.time()]