Catalyst Internet Mail .NET

InternetMail.Date Property

Gets and sets the date for the current message.

[Visual Basic]
Public Property Date As String
[C#]
public string Date {get; set;}

Property Value

A string which specifies the date in RFC 822 format.

Remarks

The Date property returns the value of the date field in the current message header. Setting this property causes the date field to be updated with the specified value. When setting the date, any one of the following formats may be used:

Format Example
mm/dd/yy[yy] hh:mm[:ss] 03/01/2006 12:00:00
yy[yy]/mm/dd hh:mm[:ss] 2006/03/01 12:00:00
dd mmm yy[yy] hh:mm[:ss] 01 Mar 2006 12:00:00
mmm dd yy[yy] hh:mm[:ss] Mar 01 2006 12:00:00

Any extraneous information that may be included in the date string, such as the day of the week, is ignored. In addition to the date and time, the string may also include a time zone specification at the end. If no time zone is specified, the current time zone is used.

When specifying a time zone, the value should either be prefixed by a plus sign (+) to indicate that the time zone is to the east of GMT, or a minus sign (-) to indicates that it's to the west. Four digits follow, with the first two indicating the number of hours east or west of GMT, and the last two digits indicating the number of minutes. Therefore, a value of -0800 means that the time zone is eight hours to the west of GMT, or in other words, the Pacific time zone.

Regardless of the format of the string assigned to the property, it always returns the date in the same format (which conforms to the RFC 822 specification). Using the above examples, the date would be returned as "Wed, 01 Mar 2006 12:00:00 -0800" if you are located in the Pacific timezone.

The Localize property affects how dates are processed by the control. If enabled, dates are automatically adjusted for the local time zone. By default, localization is disabled.

See Also

InternetMail Class | SocketTools Namespace