DateTimeOffsetConverter Constructor

Initializes a new DateTimeOffsetConverter instance and allows to specify a format string.

Definition

Namespace: FolkerKinzel.CsvTools.Mappings.TypeConverters
Assembly: FolkerKinzel.CsvTools.Mappings (in FolkerKinzel.CsvTools.Mappings.dll) Version: 1.1.0+1263e8243dc2cd78095f678f813d7d9c52ea4315
C#
public DateTimeOffsetConverter(
	IFormatProvider? formatProvider = null,
	string? format = "O",
	DateTimeStyles styles = DateTimeStyles.AllowWhiteSpaces|DateTimeStyles.RoundtripKind,
	bool parseExact = false,
	bool throwing = true,
	DateTimeOffset defaultValue = default
)

Parameters

formatProvider  IFormatProvider  (Optional)
An IFormatProvider instance that provides culture-specific formatting information, or null for InvariantCulture.
format  String  (Optional)
A format string that is used for the String output of DateTimeOffset values. If the option parseExact is selected, this format string is also used for parsing.
styles  DateTimeStyles  (Optional)
A combined value of the DateTimeStyles enum that provides additional information for parsing.
parseExact  Boolean  (Optional)
If true, the text in the CSV file must exactly match the format string specified with format.
throwing  Boolean  (Optional)
Sets the value of the Throwing property.
defaultValue  DateTimeOffset  (Optional)
Sets the value of the DefaultValue property.

Exceptions

ArgumentNullExceptionformat is null and parseExact is true.
ArgumentOutOfRangeExceptionThe value of styles is invalid.

See Also