Skip to content

Conversation

codetyri0n
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

  • The current_time() function currently uses UTC tz. This PR updates current_time() to use the tz set in 'datafusion.execution.time_zone'

What changes are included in this PR?

  • current_time() returns a tz aware date via the 'datafusion.execution.time_zone' config option.

Are these changes tested?

  • Tested with Datafusion CLI with slt covering popular scenarios added.

@github-actions github-actions bot added documentation Improvements or additions to documentation sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Oct 13, 2025
@codetyri0n
Copy link
Contributor Author

Could you please take a look to review this and #18034 @Omega359 , thank you.

@codetyri0n
Copy link
Contributor Author

@comphead this is a similar PR to #18034 and have made appropriate changes similar to the ones recommended in #18034
Have also commented out a flaky test in current date slt which was passing a while back.

SET datafusion.execution.time_zone = '+08:00';

query B
SELECT current_time() = current_time();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking what exactly we testing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the intention is to have a scenario that has a timezone set with a positive offset from UTC.

@codetyri0n codetyri0n requested a review from comphead October 15, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make current_time aware of execution timezone

2 participants