BigQuery转换为其他时区 [英] BigQuery converting to a different timezone
问题描述
我将数据存储在Google大查询的unixtimestamp中。但是,当用户要求提供报告时,她将需要按本地时区对数据进行过滤和分组。
I am storing data in unixtimestamp on google big query. However, when the user will ask for a report, she will need the filtering and grouping of data by her local timezone.
数据存储在GMT中。用户可能希望在EST中查看数据。该报告可能会要求将数据按日期分组。
The data is stored in GMT. The user may wish to see the data in EST. The report may ask the data to be grouped by date.
I don't see the timezone conversion function here:
有人知道我如何在bigquery中做到这一点吗?即将时间戳转换为其他时区后如何分组?
Does anyone know how I can do this in bigquery? i.e. how do i group by after converting the timestamp to a different timezone?
推荐答案
2016更新: 在下面查看答案,BigQuery现在提供时间戳和时区方法。
您是对的-BigQuery不提供任何时间戳转换方法。
You are right - BigQuery doesn't provide any timestamp conversion methods.
在这种情况下,建议您根据GMT / UTC时间戳字段的尺寸运行GROUP BY,然后进行转换并在您的代码中的本地时区中显示结果。
In this case, I suggest that you run your GROUP BY based on dimensions of the GMT/UTC timestamp field, and then convert and display the result in the local timezone in your code.
这篇关于BigQuery转换为其他时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!