Jump to content
PavelX

another StrToDateTime question

Recommended Posts

Hi,

How to include timezone into StrToDateTime  format

I want to convert the following string "Wed, 11 Nov 2020 22:44:00 +0000" to DateTime

 

Thank you in advance

Paul

 

Share this post


Link to post

It looks like this is a RFC822 format and can be converted using a

Indy function StrInternetToDateTime from IdGlobalProtocols

Edited by PavelX

Share this post


Link to post

Or the GMTToLocalDateTime() function, also in the IdGlobalProtocols unit.

 

StrInternetToDateTime() ignores the timezone specified in the input string and just returns the date/time as-is.

 

GMTToLocalDateTime() adjusts the date/time into UTC using the specified timezone, and then adjusts the UTC into the local timezone on output.

Edited by Remy Lebeau

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×