• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

babelfish-for-postgresql / babelfish_extensions / 11797612390

12 Nov 2024 12:49PM UTC coverage: 73.702% (+0.005%) from 73.697%
11797612390

push

github

web-flow
Fix date functions to take into account the timezone setting (#2947) (#3097)

* Fix date functions to take into account the timezone setting (#2947)

Issues -

When the timezone parameter group setting is set to something other than the default UTC, Babelfish date
related functions like SYSDATETIME(), SYSDATETIMEOFFSET(), GETDATE() and CURRENT_TIMESTAMP don't take it
into account, while they should. The same issue occurs with a session-level timezone parameter.
SYSDATETIMEOFFSET() function returns datetimeoffset which does not store timezone due to incorrect casting
function.

Changes made to fix the issues -

Added appropriate CAST from TIMESTAMP to respective return types of date functions to ensure proper accounting for
timezone setting. Added timestamptz_datetimeoffset function for converting timestamp with time zone to
datetimeoffset. It ensures to store timezone property similar to timestamptz_datetime2 and timestamptz_datetime
functions.

Task: BABEL-5069
Signed-off-by: Anikait Agrawal <agraani@amazon.com>

18 of 22 new or added lines in 3 files covered. (81.82%)

6 existing lines in 2 files now uncovered.

44235 of 60019 relevant lines covered (73.7%)

127042.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.05
/contrib/babelfishpg_common/src/datetimeoffset.c


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc