How add-rows API deals timezone for datetime fields

Hello guys,

I have a question for using the AppSheet API to add rows having datetime fields by input strings containing timezone (formatted like ISO 8601). It seems the API does parse the input string property as a datetime, but then it stores the datetime value without the timezone. The timezone property specified in the API request seems to be ignored and wonโ€™t work as expected. The datetime value is eventually stored in UTC timezone which is not good to show in a non-UTC timezone area (i.e. most of the world).

For example, I have a record containing a datetime field with a ISO8601-encoded string as below:

{ id: "foo", โ€ฆ, created_at: "2020-07-06T21:40:03+09:00" }

This record will be stored in the sheet as below

| id | โ€ฆ | created_at |
|-|-|-|
|foo| โ€ฆ | 2020/07/06 12:40:03 |

Here, itโ€™s good to see the ISO8601 formatted string parsed as a datetime value property (in UTC); however, the result (โ€œ2020/07/06 12:40:03โ€) gets stripped of the timezone info.

I suppose the API will convert the datetime to the right format by given properties of โ€œLocaleโ€ and โ€œTimezoneโ€, but it doesnโ€™t, so Iโ€™d like to make it sure.

As a workaround, I can tweak my server to pass pre-converted strings of datetime values, but itโ€™s nice to have a much โ€œlowerโ€ solution on it.

Thanks,

References:

1 2 351
2 REPLIES 2

So you want to see it or to be recorded as 2020/07/06 12:40:03+00:00 to your back-end?

Yes, that would be better.

And if there is a timezone set to other than UTC like 2020/07/06 21:40:03+09:00, it would be much better.

Top Labels in this Space