wit icon indicating copy to clipboard operation
wit copied to clipboard

timezone context reference_time returning incorrect datetime

Open bmcclenahan opened this issue 9 years ago • 7 comments

Do you want to request a feature, report a bug, or ask a question about wit? bug What is the current behavior? when I pass my current time in the reference_time property of context, the datetime that is returned is for a different timezone - I am passing a time in GMT+10 and asking about tomorrow and the times returned are for GMT-7 - I ask for tomorrow and instead of getting midnight to midnight in +10 timezone I am returned midnight in -7 timezone

Also the documentation is misleading. The example for reference_time in the Context section of the doc shows a time string with timezone, but the API returns an error if this format is used.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. 2017-06-10 10:18:37:747 +1000 001211 INFO Timezone: {"reference_time":"2017-06-10T10:18:37"} 2017-06-10 10:18:38:355 +1000 001819 INFO 1501175216601252 Wit Response: {"msg_id":"mid.$cAACRUdww5jBiwKMyfFcj13imsddi","_text":"who is singing tomorrow","entities":{"position":[{"metadata":"singers","confidence":0.98385124686966,"value":"sing","type":"value"}],"datetime":[{"confidence":0.9979992915359,"values":[{"value":"2017-06-11T00:00:00.000-07:00","grain":"day","type":"value"}],"value":"2017-06-11T00:00:00.000-07:00","grain":"day","type":"value"}],"intent":[{"confidence":0.99989792133016,"value":"roster_query"}]}} What is the expected behavior? I would expect datetime returned to be {"value":"2017-06-11T00:00:00.000+10:00","grain":"day","type":"value"}

What is the App ID where you are experiencing this issue (if applicable)? 58aecb8b-e2a7-46ff-8f5d-3a04e81575ac

bmcclenahan avatar Jun 10 '17 00:06 bmcclenahan

seems that whatever timezone the reference_time uses, the response datetime for tomorrow is always GMT-7

bmcclenahan avatar Jun 10 '17 01:06 bmcclenahan

Would someone at Wit be able to look at this please ? it seems like it might be a bug

bmcclenahan avatar Jun 23 '17 16:06 bmcclenahan

cc @patapizza could it be related to our migration to the new Duckling?

l5t avatar Jun 23 '17 18:06 l5t

I'll have a look.

patapizza avatar Jun 25 '17 17:06 patapizza

The context object needs to be passed as a URL parameter. Make sure it's a valid encoded string.

patapizza avatar Jun 27 '17 17:06 patapizza

YES, context has been passed as a URL parameter. YES, context is a valid encoded string When I change the format of the reference_time string, and error is reported, so I deduce that it is being passed and received. Could you please revisit this issue

bmcclenahan avatar Jun 27 '17 19:06 bmcclenahan

@bmcclenahan Can you provide me with a cURL example that doesn't work? Thanks.

patapizza avatar Jun 27 '17 21:06 patapizza