문제

I'm using the python bigquery api. I'm streaming data into a table and would like to store the data record generation timestamp in both UTC and the local time where the data was generated.

I'm passing in the following:

...
"timestamp_utc": "2014-04-04 09:01:10.762137+00:00",
"timestamp_local_time": "2014-04-04 11:01:10.762137+02:00",
...

Both of these result in columns with the time stored as 09:01:10 UTC. Is this a known limitation or am I doing something wrong?

도움이 되었습니까?

해결책

The Bigquery timestamp time does not record a timezone. The input time is always converted to and stored in UTC. Queries and table reads return the timestamp as a unix timestamp expressed as floating point seconds since the epoch 1970-01-01 00:00:00 UTC. The Web UI always renders times in the UTC timezone.

So to summarize the two times in your example are equivalent as far as the BigQuery timestamp type is concerned.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top