DateAndOrTimeCreate(DateTimeOffset, Boolean, Boolean, Boolean) Method

Creates a new DateAndOrTime instance from a DateTimeOffset value.

Definition

Namespace: FolkerKinzel.VCards.Models
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public static DateAndOrTime Create(
	DateTimeOffset value,
	bool ignoreYear = false,
	bool ignoreMonth = false,
	bool ignoreDay = false
)

Parameters

value  DateTimeOffset
The DateTimeOffset value.
ignoreYear  Boolean  (Optional)
Pass true to ignore the Year part, otherwise false.
ignoreMonth  Boolean  (Optional)
Pass true to ignore the Month part, otherwise false.
ignoreDay  Boolean  (Optional)
Pass true to ignore the Day part, otherwise false.

Return Value

DateAndOrTime
The newly created DateAndOrTime instance.

Remarks

If value has neither a date nor a time, the method returns an empty instance.

If ignoreDay is true and ignoreMonth or ignoreYear is false, the time component is ignored and the newly created instance will encapsulate a DateOnly value.

See Also