Skip to content

Conversation

@michalsn
Copy link
Member

@michalsn michalsn commented Feb 3, 2026

Description
This PR adds a new timezone configuration option to synchronize database session timezone with application timezone, ensuring consistent timestamps between model operations and database functions like NOW().

Modern database environments usually have UTC set by default, so this option may not be needed in most cases. This feature is primarily useful when working with legacy systems, shared hosting environments, etc., where the database timezone cannot be controlled at the server level.

Not supported drivers:

  • SQLite3 - has no concept of session-level timezone configuration. All datetime functions operate in UTC by default.
  • SQLSRV - does not support session-level timezone changes. It derives datetime from the operating system and cannot be changed at the session or instance level.

Closes #9903

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added enhancement PRs that improve existing functionalities 4.8 PRs that target the `4.8` branch. labels Feb 3, 2026
@michalsn michalsn linked an issue Feb 3, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: CodeIgniter doesn't set the timezone in database sessions

2 participants