Warning

 

Close

Confirm Action

Are you sure you wish to do this?

Confirm Cancel
BCM
User Panel

Posted: 3/24/2021 11:47:15 AM EDT
What format is this? "Wed, 7 Oct 2015 12:34:56 -0700"

I need to parse it but can't figure out a format that starts with the day of week.
Link Posted: 3/24/2021 12:34:15 PM EDT
[#1]
-0700 is the time zone.  It's zulu time minus 7 hours.  Eastern tz is z-5, so z-7 would be mountain time zone, I think.

ETA: sorry, misunderstood the question.
Link Posted: 3/24/2021 12:50:42 PM EDT
[#2]
That looks like RFC 2822.
Link Posted: 3/24/2021 1:48:58 PM EDT
[#3]
Discussion ForumsJump to Quoted PostQuote History
Quoted:
That looks like RFC 2822.
View Quote



Yep. Easy to parse in Python:

>>> from email.utils import parsedate
>>> parsedate('Wed, 7 Oct 2015 12:34:56 -0700')
(2015, 10, 7, 12, 34, 56, 0, 1, -1)
>>>



Probably easy to parse in most other languages also.

Link Posted: 3/24/2021 2:02:59 PM EDT
[#4]
Yeah. I was trying to figure out the name for the format. Like if it is an ISO standard.
Turns out that python doesn't care so it doesn't matter.
Close Join Our Mail List to Stay Up To Date! Win a FREE Membership!

Sign up for the ARFCOM weekly newsletter and be entered to win a free ARFCOM membership. One new winner* is announced every week!

You will receive an email every Friday morning featuring the latest chatter from the hottest topics, breaking news surrounding legislation, as well as exclusive deals only available to ARFCOM email subscribers.


By signing up you agree to our User Agreement. *Must have a registered ARFCOM account to win.
Top Top