Hunny Software Library Reference

Imap4Utility.FromDateString Method 

Parses an IMAP4 date and time string.

[Visual Basic]
Public Shared Sub FromDateString( _
   ByVal str As String, _
   ByRef dateTime As Date, _
   ByRef zone As TimeSpan _
)
[C#]
public static void FromDateString(
   string str,
   out DateTime dateTime,
   out TimeSpan zone
);

Parameters

str
A string that contains the date and time in IMAP4 format.
dateTime
A System.DateTime instance with the parsed date and time.
zone
The time difference between the represented date and time and UTC. (For example, the standard zone for New York is -5 hours.)

Remarks

You may use this utility method to parse an IMAP4 date and time string.

IMAP4 uses this date and time format for the INTERNALDATE message attribute. The format of the IMAP4 date and time string is dd-mmm-YYYY HH:MM:SS ZZZZZ.

Example: 3-May-2004 12:22:04 -0500

You may use the static method ToDateString to create an IMAP4 date and time string.

Exceptions

Exception TypeCondition
FormatException The format is invalid.

See Also

Imap4Utility Class | Hunny.Mail Namespace