3

Using FreePascal (FPC) 2.6.2 I'd like to convert into DateTime values some timestamp strings from email messages (retrieved from an IMAP server using Synapse IMAPsend):

Date: Thu, 1 Aug 2013 20:07:43 -0400

From what I've read of StrToDateTime() and TFormatSettings, I don't see a way to do this directly. They typically expect strings like 1/8/2013 20:07:47 with formats like dd/mm/yyyy & hh:mm:ss and have no way to handle the UTC offset.

Is it necessary for me to first chop-up and rearrange the string and do my own conversion of short month-names and offsets?

1
  • I don't know FreePascal but isn't there something if you search the help for'timestamp', 'timezone' or 'utc'?
    – Jan Doggen
    Aug 2, 2013 at 14:18

1 Answer 1

8

if you use Synapse; in synautil.pas file you can find DecodeRfcDateTime function. With this function you can do what you ask.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.