Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timezone feature does not work as expected #515

Open
localvar opened this issue Mar 4, 2024 · 3 comments
Open

timezone feature does not work as expected #515

localvar opened this issue Mar 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@localvar
Copy link
Contributor

localvar commented Mar 4, 2024

Describe the bug(Bug 描述)

I trie to use timezone 'Asia/Shanghai' and 'America/Chicago' but the returned timestamp are all the same.

To Reproduce(Bug 复现步骤)

> use db0
> insert cpu,host=server-01,region=east-cn disk=10i,memory=100i,network=1243i
> insert cpu,host=server-01,region=east-cn disk=132i,memory=214i,network=513i
> select * from cpu
name: cpu
+---------------------+------+-----------+--------+---------+---------+
|        time         | disk |   host    | memory | network | region  |
+---------------------+------+-----------+--------+---------+---------+
| 1709515227157434300 |   10 | server-01 |    100 |    1243 | east-cn |
| 1709515248896036100 |  132 | server-01 |    214 |     513 | east-cn |
+---------------------+------+-----------+--------+---------+---------+
6 columns, 2 rows in set

> select * from cpu tz('Asia/Shanghai')
name: cpu
+---------------------+------+-----------+--------+---------+---------+
|        time         | disk |   host    | memory | network | region  |
+---------------------+------+-----------+--------+---------+---------+
| 1709515227157434300 |   10 | server-01 |    100 |    1243 | east-cn |
| 1709515248896036100 |  132 | server-01 |    214 |     513 | east-cn |
+---------------------+------+-----------+--------+---------+---------+
6 columns, 2 rows in set

> select * from cpu tz('America/Chicago')
name: cpu
+---------------------+------+-----------+--------+---------+---------+
|        time         | disk |   host    | memory | network | region  |
+---------------------+------+-----------+--------+---------+---------+
| 1709515227157434300 |   10 | server-01 |    100 |    1243 | east-cn |
| 1709515248896036100 |  132 | server-01 |    214 |     513 | east-cn |
+---------------------+------+-----------+--------+---------+---------+
6 columns, 2 rows in set

Expected behavior(期望结果)

No response

Screenshots(屏幕截图)

No response

Logs(完整的错误日志)

No response

Additional context(其他的一些补充内容)

No response

@localvar localvar added the bug Something isn't working label Mar 4, 2024
@xiangyu5632
Copy link
Member

the returned timestamp must be in RFC3339 format for the UTC offset to appear.
set rfc3339 format

> precision rfc3339

please have a try.

@localvar
Copy link
Contributor Author

localvar commented Mar 4, 2024

@xiangyu5632

same result, always UTC+0, and the example in this document is using timestamp, not rfc3339.

> select * from cpu
name: cpu
+------------------------------+------+-----------+--------+---------+---------+
|             time             | disk |   host    | memory | network | region  |
+------------------------------+------+-----------+--------+---------+---------+
| 2024-03-04T01:20:27.1574343Z |   10 | server-01 |    100 |    1243 | east-cn |
| 2024-03-04T01:20:48.8960361Z |  132 | server-01 |    214 |     513 | east-cn |
+------------------------------+------+-----------+--------+---------+---------+
6 columns, 2 rows in set

>  select * from cpu tz('Asia/Shanghai')
name: cpu
+------------------------------+------+-----------+--------+---------+---------+
|             time             | disk |   host    | memory | network | region  |
+------------------------------+------+-----------+--------+---------+---------+
| 2024-03-04T01:20:27.1574343Z |   10 | server-01 |    100 |    1243 | east-cn |
| 2024-03-04T01:20:48.8960361Z |  132 | server-01 |    214 |     513 | east-cn |
+------------------------------+------+-----------+--------+---------+---------+
6 columns, 2 rows in set

> select * from cpu tz('America/Chicago')
name: cpu
+------------------------------+------+-----------+--------+---------+---------+
|             time             | disk |   host    | memory | network | region  |
+------------------------------+------+-----------+--------+---------+---------+
| 2024-03-04T01:20:27.1574343Z |   10 | server-01 |    100 |    1243 | east-cn |
| 2024-03-04T01:20:48.8960361Z |  132 | server-01 |    214 |     513 | east-cn |
+------------------------------+------+-----------+--------+---------+---------+
6 columns, 2 rows in set

@xiangyu5632
Copy link
Member

right, it's really a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants