Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Mar 7, 2025

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.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Artem-OSSRevival seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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