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

datetime functions fix to return the correct timezone value #6009

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Artem-OSSRevival
Copy link

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number: #5894 #5735

Description:

The date() and tostring() functions return the value without taking into account the user's time zone offset, while other functions, datetime() and time(), do this. The output has different values.

Fixed return values ​​of functions: date(), tostring(date()), tostring(datetime()), tostring(time()). Now the values ​​returned by them correspond to other ones like datetime() or time().

How do you solve it?

Added the time zone offset performing to the functions.

Special notes for your reviewer, ex. impact of this fix, design document, etc:

To reproduce: add “--timezone_name=UTC+11:00“ (or +12, so there is some offset to a time after midnight [next day]) to “/usr/local/nebula/etc/nebula-graphd.conf” and then start the nebula services.

Before:
before-#5894
before-#5735


After:
after-#5894
after-#5735

Unit Tests:
after_twice_timezone_conversion_test
after_function_manager_test

Checklist:

Tests:

  • Unit test (positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Fixed the bug of returning the incorrect timezone values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants