'Dialogflow wrong time format
Basically, my agent is French, and when I type 10h (10am for 12hour format) my DialogFlow agent is understanding 22h (10PM) but I want him to understand 10AM. (I want 24 hour format).
And the strange thing is that when I type 14h, my agent is understanding 2PM.
Maybe I need to modify somewhere the time format from 12 to 24 but I can't find where.
Sorry for this poor english and explanation hope you understand.
Solution 1:[1]
This seems like a long shot, but have you tried using the @sys.date-time entity instead?
According to the Dialogflow Enterprise (FR) documentation, @sys.date-time accepts inputs like
14h30
13 juillet
avril
Matin
demain à 16h30
demain dans l'après-midi
and returns objects like
"2018-04-05T14:30:00-06:00"
"2018-07-13T18:00:00-06:00"
{"startDate":"2018-04-01T12:00:00-06:00","endDate":"2018-04-30T12:00:00-06:00"}
{"startTime":"2018-04-06T08:00:00-06:00","endTime":"2018-04-06T12:00:00-06:00"}
{"date_time":"2018-04-06T16:30:00-06:00"}
{"startDateTime":"2018-04-06T12:00:00-06:00","endDateTime":"2018-04-06T16:00:00-06:00"}
Solution 2:[2]
I tried
function getLocaleTimeString(dateObj){
return dateObj.toLocaleTimeString('pt-BR', { hour: 'numeric', hour12: false });
}
and didn't worked :-(
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Max Wiederholt |
| Solution 2 | LuizC |



