Jamie
Jamie

Reputation: 3172

Convert RFC 822 Date to TDateTime

Can anyone suggest a Delphi library that will covert a date string in the RFC 822 format to a TDateTime?

e.g. 24 Oct 2011 13:54:55 -0000

I imagine this is something that you could easily get wrong due to slight variations in formats returned by servers, so a tried and tested routine would be good.

Can this be achieved with the built in StrToDateTime routine using a custom short date format sting?

Note: I'm using Delphi 2010

Upvotes: 4

Views: 2180

Answers (1)

Ondrej Kelle
Ondrej Kelle

Reputation: 37211

Indy's TIdDateTimeStamp (since Indy 9) has SetFromRFC822 method which calls StrInternetToDateTime.

Upvotes: 13

Related Questions