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

The time is incorrect after the time_zone is changed #4999

Closed
Hester-Gu opened this issue Dec 6, 2022 · 2 comments
Closed

The time is incorrect after the time_zone is changed #4999

Hester-Gu opened this issue Dec 6, 2022 · 2 comments
Assignees
Labels
affects/master PR/issue: this bug affects master version. process/done Process of bug severity/minor Severity of bug type/question Type: question about the product wontfix Solution: this will not be worked on recently
Milestone

Comments

@Hester-Gu
Copy link

Please check the FAQ documentation before raising an issue

when time_zone is default UTC+00:00:00

(root@nebula) [(none)]> RETURN now(), timestamp(), date(), time(), datetime();
+------------+-------------+------------+-----------------+----------------------------+
| now()      | timestamp() | date()     | time()          | datetime()                 |
+------------+-------------+------------+-----------------+----------------------------+
| 1670315448 | 1670315448  | 2022-12-06 | 08:30:48.160000 | 2022-12-06T08:30:48.160000 |
+------------+-------------+------------+-----------------+----------------------------+
Got 1 rows (time spent 224/519 us)

Tue, 06 Dec 2022 16:30:48 CST

(root@nebula) [(none)]>  return time("19:03:00") > time("07:59:59")
+-------------------------------------+
| (time("19:03:00")>time("07:59:59")) |
+-------------------------------------+
| true                                |
+-------------------------------------+
Got 1 rows (time spent 266/508 us)

Tue, 06 Dec 2022 16:27:27 CST

(root@nebula) [(none)]> 
(root@nebula) [(none)]> return time("19:03:00") > time("08:00:00")
+-------------------------------------+
| (time("19:03:00")>time("08:00:00")) |
+-------------------------------------+
| true                                |
+-------------------------------------+
Got 1 rows (time spent 216/439 us)

but when time_zone is UTC+08:00

(root@nebula) [(none)]> return time("19:03:00") > time("07:59:59")
+-------------------------------------+
| (time("19:03:00")>time("07:59:59")) |
+-------------------------------------+
| false                               |
+-------------------------------------+
Got 1 rows (time spent 402/695 us)

Tue, 06 Dec 2022 16:35:51 CST

(root@nebula) [(none)]> return time("19:03:00") > time("08:00:00")
+-------------------------------------+
| (time("19:03:00")>time("08:00:00")) |
+-------------------------------------+
| true                                |
+-------------------------------------+
Got 1 rows (time spent 284/538 us)

Tue, 06 Dec 2022 16:35:56 CST

(root@nebula) [(none)]> RETURN now(), timestamp(), date(), time(), datetime();
+------------+-------------+------------+-----------------+----------------------------+
| now()      | timestamp() | date()     | time()          | datetime()                 |
+------------+-------------+------------+-----------------+----------------------------+
| 1670315763 | 1670315763  | 2022-12-06 | 16:36:03.894000 | 2022-12-06T16:36:03.894000 |
+------------+-------------+------------+-----------------+----------------------------+
Got 1 rows (time spent 291/629 us)

Tue, 06 Dec 2022 16:36:03 CST

return time("19:03:00")>time("07:59:59") is false

Describe the bug (required)

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id v3.1.0

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1
  2. Step 2
  3. Step 3

Expected behavior

Additional context

@Hester-Gu Hester-Gu added the type/bug Type: something is unexpected label Dec 6, 2022
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug labels Dec 6, 2022
@Sophie-Xie Sophie-Xie added this to the v3.4.0 milestone Dec 7, 2022
@HarrisChu HarrisChu added severity/minor Severity of bug affects/master PR/issue: this bug affects master version. labels Dec 7, 2022
@github-actions github-actions bot removed severity/none Severity of bug affects/none PR/issue: this bug affects none version. labels Dec 7, 2022
@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Dec 8, 2022

It's caused by Time overflow after converting Timezone.

@Shylock-Hg Shylock-Hg added type/question Type: question about the product and removed type/bug Type: something is unexpected labels Dec 8, 2022
@Shylock-Hg
Copy link
Contributor

@foesa-yang Please note this on document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/master PR/issue: this bug affects master version. process/done Process of bug severity/minor Severity of bug type/question Type: question about the product wontfix Solution: this will not be worked on recently
Projects
None yet
Development

No branches or pull requests

4 participants