cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting options of a date directly in SAP CAI and time zone setting

Former Member
0 Kudos
593

Hello,

how is it possible to output a date directly in SAP CAI in a user-friendly format? As I said, I want to do that directly in SAP CAI. However, there are only the following properties under #DATETIME.

In addition, the time zone is always set to +0000. Why is not the user's timezone taken here?

Thanks in advance!

Yours sincerely

Philipp Barnickel

View Entire Topic

Hi Philipp,

We provide several useful information when enriching a #DATETIME, as seen below:

{
  "formatted": "Sunday, 28 July 2019 at 09:43:42 AM (+0000)",
  "iso": "2019-07-28T09:43:42+00:00",
  "accuracy": "day",
  "chronology": "past",
  "state": "relative",
  "raw": "two days ago",
  "confidence": 0.99
}

The key that should help you is "formatted", which is displaying the absolute representation of the date and time in a human-readable format.

We enrich all #DATETIMEs in UTC, simply because there is no mechanism to forward the timezone of the end-user from the webchat to our NLP engine, yet.

Hope that helps,

Former Member
0 Kudos

Hello Paul,


thank you for your answer.And how can you use only the information you need for a variety of use cases from the property "formatted"?For example, you just want to return "July 31, 2019" in a confirmation from the chatbot, not the time and time zone. Is not it much more useful to extract this information and then the chatbot designer can assemble his specific date format directly into the SAP CAI?

I hope that was understandable

Best wishes

Philipp Barnickel