Unosquare
    Show / Hide Table of Contents

    Class HttpDate

    Provides standard methods to parse and format s according to various RFCs.

    Inheritance
    Object
    HttpDate
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: EmbedIO.Utilities
    Syntax
    public static class HttpDate

    Methods

    Format(DateTime)

    Formats the specified according to RFC1123.

    Declaration
    public static string Format(DateTime dateTime)
    Parameters
    Type Name Description
    DateTime dateTime

    The to format.

    Returns
    Type Description
    String

    A string containing the formatted dateTime.

    Format(DateTimeOffset)

    Formats the specified according to RFC1123.

    Declaration
    public static string Format(DateTimeOffset dateTimeOffset)
    Parameters
    Type Name Description
    DateTimeOffset dateTimeOffset

    The to format.

    Returns
    Type Description
    String

    A string containing the formatted dateTimeOffset.

    TryParse(String, out DateTimeOffset)

    Attempts to parse a string containing a date and time, and possibly a time zone offset, in one of the formats specified in RFC850, RFC1123, and RFC5322, or ANSI C's asctime()https://linux.die.net/man/3/asctime format.

    Declaration
    public static bool TryParse(string str, out DateTimeOffset result)
    Parameters
    Type Name Description
    String str

    The string to parse.

    DateTimeOffset result

    When this method returns true, a representing the parsed date, time, and time zone offset. This parameter is passed uninitialized.

    Returns
    Type Description
    Boolean

    true if str was successfully parsed; otherwise, false.

    Comments

    Back to top Copyright © 2017-2019 Unosquare