Iso8601Utils.TryParse method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Time.Iso8601
Assembly Skybrud.Essentials.dll

TryParse(string, out DateTime)

Static

Converts the specified iso8601 formatted date and time to its DateTime equivalent and returns a value that indicates whether the conversion succeeded.

public static bool TryParse(string iso8601, DateTime result)

Parameters

iso8601 String

The string with the ISO 8601 formatted date and time.

result DateTime

When this method returns, contains the DateTime value equivalent to the date and time contained in iso8601, if the conversion succeeded, or System.DateTime.MinValue if the conversion failed.

Returns

true if the iso8601 parameter was converted successfully; otherwise, false.

TryParse(string, out DateTimeOffset)

Static

Converts the specified iso8601 formatted date and time to its DateTimeOffset equivalent and returns a value that indicates whether the conversion succeeded.

public static bool TryParse(string iso8601, DateTimeOffset result)

Parameters

iso8601 String

The string with the ISO 8601 formatted date and time.

When this method returns, contains the DateTimeOffset value equivalent to the date and time contained in iso8601, if the conversion succeeded, or System.DateTimeOffset.MinValue if the conversion failed.

Returns

true if the iso8601 parameter was converted successfully; otherwise, false.