Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: string ToIsoString(this DateTime, IsoDatePrecision, IsoDateFormat, bool)

Declaration

public static string ToIsoString(
    this DateTime datetime,
    IsoDatePrecision precision = IsoDatePrecision.Seconds,
    IsoDateFormat format = IsoDateFormat.HumanReadable,
    bool includeTimezone = false
)

Summary

Returns a string representation of the date/time in an ISO-8601 compatible (or very close) format.

Parameters

this DateTimedatetimeDate/time to convert.
IsoDatePrecisionprecisionWhich date/time components are to be included. The values are truncated, not rounded.
IsoDateFormatformatOne of the several pre-defined formats to use.
boolincludeTimezoneSpecifies whether a suffix indicating date/time kind (local/utc/unspecified) and, for local times, a UTC offset, is appended.