DateTimeOffsetToFirebirdZonedTimeResolver
A class used to resolve a DateTimeOffset into the FbZonedTime value that is written into a Firebird TIME WITH TIME ZONE column.
This IResolver<DateTimeOffset, object> implementation converts a DateTimeOffset into the FbZonedTime (boxed) that the FirebirdSql.Data.FirebirdClient driver writes into a TIME WITH TIME ZONE column. The value holds the UTC time of day, and the offset as the name of a fixed-offset Etc/GMT time zone, resolved by the TimeSpanToFirebirdTimeZoneNameResolver. It is used by the FirebirdZonedTimeToDateTimeOffsetPropertyHandler and the FirebirdZonedTimeToNullableDateTimeOffsetPropertyHandler when writing the entity property back to the database.
The date part of the
DateTimeOffsetis not written, as aTIME WITH TIME ZONEvalue has none. The counterpart of this class is the FirebirdZonedValueToDateTimeOffsetResolver, which converts the value read from the column back into aDateTimeOffset. For aTIMESTAMP WITH TIME ZONEcolumn, use the DateTimeOffsetToFirebirdZonedDateTimeResolver.
Usability
var resolver = new DateTimeOffsetToFirebirdZonedTimeResolver();
var value = resolver.Resolve(new DateTimeOffset(2026, 9, 21, 10, 30, 0, TimeSpan.FromHours(3)));
// FbZonedTime, 07:30:00 UTC in the "Etc/GMT-3" time zone (boxed)
Constructors
| Constructor | Description |
|---|---|
DateTimeOffsetToFirebirdZonedTimeResolver() |
Creates a new instance using the TimeSpanToFirebirdTimeZoneNameResolver. |
DateTimeOffsetToFirebirdZonedTimeResolver(IResolver<TimeSpan, string> timeZoneNameResolver) |
Creates a new instance using the custom resolver that converts the UTC offset into the name of a Firebird time zone. |