Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 609
Jamie Avatar asked Dec 13 '22 08:12

Jamie


1 Answers

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

like image 52
Ondrej Kelle Avatar answered Jan 30 '23 20:01

Ondrej Kelle