Show / Hide Table of Contents

Class SyndicationDateTimeUtility

Provides methods for generating and parsing date-time information exposed by syndicated content. This class cannot be inherited.

Inheritance
System.Object
SyndicationDateTimeUtility
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Argotic.Common
Assembly: Argotic.Common.dll
Syntax
public static class SyndicationDateTimeUtility
Remarks

See RFC #822: Standard for ARPA Internet Text Messages (Date and Time Specification) and RFC #3339: Date and Time on the Internet (Timestamps) for further information about the date-time formats implemented in the SyndicationDateTimeUtility class.

Methods

| Improve this Doc View Source

ParseRfc3339DateTime(String)

Converts the specified string representation of a RFC-3339 formatted date to its System.DateTime equivalent.

Declaration
public static DateTime ParseRfc3339DateTime(string value)
Parameters
Type Name Description
System.String value

A string containing a RFC-3339 formatted date to convert.

Returns
Type Description
System.DateTime

A System.DateTime equivalent to the RFC-3339 formatted date contained in value.

Exceptions
Type Condition
System.ArgumentNullException

The value is a null reference (Nothing in Visual Basic).

System.ArgumentNullException

The value is an empty string.

System.FormatException

The value is not a recognized as a RFC-3339 formatted date.

| Improve this Doc View Source

ParseRfc822DateTime(String)

Converts the specified string representation of a RFC-822 formatted date to its System.DateTime equivalent.

Declaration
public static DateTime ParseRfc822DateTime(string value)
Parameters
Type Name Description
System.String value

A string containing a RFC-822 formatted date to convert.

Returns
Type Description
System.DateTime

A System.DateTime equivalent to the RFC-822 formatted date contained in value.

Exceptions
Type Condition
System.ArgumentNullException

The value is a null reference (Nothing in Visual Basic).

System.ArgumentNullException

The value is an empty string.

System.FormatException

The value is not a recognized as a RFC-822 formatted date.

| Improve this Doc View Source

ToRfc3339DateTime(DateTime)

Converts the value of the supplied System.DateTime object to its equivalent RFC-3339 date string representation.

Declaration
public static string ToRfc3339DateTime(DateTime utcDateTime)
Parameters
Type Name Description
System.DateTime utcDateTime

The UTC System.DateTime object to convert.

Returns
Type Description
System.String

A string that contains the RFC-3339 date string representation of the supplied System.DateTime object.

| Improve this Doc View Source

ToRfc822DateTime(DateTime)

Converts the value of the supplied System.DateTime object to its equivalent RFC-822 date string representation.

Declaration
public static string ToRfc822DateTime(DateTime dateTime)
Parameters
Type Name Description
System.DateTime dateTime

The System.DateTime object to convert.

Returns
Type Description
System.String

A string that contains the RFC-822 date string representation of the supplied System.DateTime object.

| Improve this Doc View Source

TryParseRfc3339DateTime(String, out DateTime)

Converts the specified string representation of a RFC-3339 formatted date to its System.DateTime equivalent.

Declaration
public static bool TryParseRfc3339DateTime(string value, out DateTime result)
Parameters
Type Name Description
System.String value

A string containing a RFC-3339 formatted date to convert.

System.DateTime result

When this method returns, contains the System.DateTime value equivalent to the date and time contained in value, if the conversion succeeded, or System.DateTime.MinValue if the conversion failed. The conversion fails if the value parameter is a null or empty string, or does not contain a valid string representation of a RFC-3339 formatted date. This parameter is passed uninitialized.

Returns
Type Description
System.Boolean

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

| Improve this Doc View Source

TryParseRfc822DateTime(String, out DateTime)

Converts the specified string representation of a RFC-822 formatted date to its System.DateTime equivalent.

Declaration
public static bool TryParseRfc822DateTime(string value, out DateTime result)
Parameters
Type Name Description
System.String value

A string containing a RFC-822 formatted date to convert.

System.DateTime result

When this method returns, contains the System.DateTime value equivalent to the date and time contained in value, if the conversion succeeded, or System.DateTime.MinValue if the conversion failed. The conversion fails if the value parameter is a null or empty string, or does not contain a valid string representation of a RFC-822 formatted date. This parameter is passed uninitialized.

Returns
Type Description
System.Boolean

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

  • Improve this Doc
  • View Source
Back to top Generated by DocFX