Skip to content

Fix Datetime localization issue when handling serverdate in PostgreSQL #1158

Merged
claudiamurialdo merged 2 commits into
masterfrom
fix/postgresql-server-now
Jun 18, 2025
Merged

Fix Datetime localization issue when handling serverdate in PostgreSQL #1158
claudiamurialdo merged 2 commits into
masterfrom
fix/postgresql-server-now

Conversation

@claudiamurialdo

Copy link
Copy Markdown
Collaborator

Added utility method NormalizeDbmsDateTime to normalize DateTime objects in postgresql by setting their Kind to Unspecified for consistent handling of time values

Issue:204406

…cts in postgresql by setting their Kind to Unspecified for consistent handling of time values
@genexusbot

Copy link
Copy Markdown
Contributor
Cherry pick to beta success

…en it is Local. This handles cases like Npgsql, which returns DateTime values with Kind=Local, causing comparisons with Kind=Unspecified to fail.

ServerNow always returns the DateTime in the local timezone of the DBMS.
@claudiamurialdo claudiamurialdo had a problem deploying to kafka-integration-tests June 17, 2025 16:58 — with GitHub Actions Failure
@claudiamurialdo claudiamurialdo had a problem deploying to external-storage-tests June 17, 2025 16:58 — with GitHub Actions Failure
@genexusbot

Copy link
Copy Markdown
Contributor
Cherry pick to beta success

@claudiamurialdo claudiamurialdo merged commit 98a2089 into master Jun 18, 2025
8 of 10 checks passed
@claudiamurialdo claudiamurialdo deleted the fix/postgresql-server-now branch June 18, 2025 15:34
claudiamurialdo added a commit that referenced this pull request Jun 20, 2025
#1158)

* Added utility method NormalizeDbmsDateTime to normalize DateTime objects in postgresql by setting their Kind to Unspecified for consistent handling of time values

* Add method ResetTimeAndKind to reset the Kind property of DateTime when it is Local. This handles cases like Npgsql, which returns DateTime values with Kind=Local, causing comparisons with Kind=Unspecified to fail.

ServerNow always returns the DateTime in the local timezone of the DBMS.

(cherry picked from commit 98a2089)

# Conflicts:
#	dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs
claudiamurialdo added a commit that referenced this pull request Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants