Skip to content

FBZonedDateTime with legacy code  #1177

@PaladinMattt

Description

@PaladinMattt

We have legacy code that supports multiple database systems and had been using:
DateTime dt = Convert.ChangeType(valueReturnedFromQuery, typeof(DateTime));
to get the datetime values. This works fine in our Firebird 3 systems, but in testing out migrating to Firebird 5, this throws the Exception:
System.InvalidCastException: 'Object must implement IConvertible.'
Is there a reason FBZonedDateTime does not implement IConvertible? It could return the DateTime in the local users time or UTC time.

This functionality could be behind an AppContext switch, much the same way Npgsql has done (Ngsql.EnableLegacyTimestampBehavior), where essentially DbDataType.TimeStampTZ is treated as DbDataType.TimeStamp

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions