BigQuery 转换为不同的时区 [英] BigQuery converting to a different timezone

查看:24
本文介绍了BigQuery 转换为不同的时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在谷歌大查询的 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.

数据以格林威治标准时间存储.用户可能希望查看 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆