.NET RFC 822 SMTP Date Format

In case you were looking for how to format a RFC 822 compliant date/time string in Visual Basic .net or Visual C# .net, here it is:

DateTime.Now.ToString("r")
>>> Thu, 10 Apr 2008 13:30:00 GMT

More information on the “r” format can be found at:

http://msdn.microsoft.com/en-us/library/az4se3k1.aspx#RFC1123

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s