wit-api-only-tutorial icon indicating copy to clipboard operation
wit-api-only-tutorial copied to clipboard

Wit-ai returns different date and time, if timezone specified

Open umasudheesh opened this issue 7 years ago • 0 comments

Hello Team,

I have set default timezone in wit-ai as "UTC".

If I say - "tomorrow 4pm"

wit returns as -

stdClass Object
(
    [_text] => tomorrow 4pm
    [entities] => stdClass Object
        (
            [datetime] => Array
                (
                    [0] => stdClass Object
                        (
                            [confidence] => 0.9617875
                            [values] => Array
                                (
                                    [0] => stdClass Object
                                        (
                                            [value] => 2019-02-09T16:00:00.000+00:00
                                            [grain] => hour
                                            [type] => value
                                        )

                                )

                            [value] => 2019-02-09T16:00:00.000+00:00
                            [grain] => hour
                            [type] => value
                        )

                )

        )

    [msg_id] => 1dYwr0tIvRLXcrV15
)

============================================ and if I say - "tomorrow 4pm pst"

wit returns as -

stdClass Object
(
    [_text] => tomorrow 4pm pst
    [entities] => stdClass Object
        (
            [datetime] => Array
                (
                    [0] => stdClass Object
                        (
                            [confidence] => 0.96017333333333
                            [values] => Array
                                (
                                    [0] => stdClass Object
                                        (
                                            [value] => 2019-02-09T00:00:00.000+00:00
                                            [grain] => minute
                                            [type] => value
                                        )

                                )

                            [value] => 2019-02-09T00:00:00.000+00:00
                            [grain] => minute
                            [type] => value
                        )

                )

        )

    [msg_id] => 15lpHscFt4Bp7YIZ7
)

================================================

My question is - how will I identify whether the user inputs along with timezone? cause I am getting the response in UTC.

My request is - Can you guys add another parameter as timezone kind of? so that we can understand that the input date time is converted from specified timezone.

Thanks.

umasudheesh avatar Feb 08 '19 09:02 umasudheesh