Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8152295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:40:04+00:00 2026-06-06T15:40:04+00:00

I am having a hard time converting a string representation of non-UTC times to

  • 0

I am having a hard time converting a string representation of non-UTC times to UTC due to the timezone abbreviation.

(update: it seems that the timezone abbreviations may not be unique. if so, perhaps i should also be trying to take this into account.)

I’ve been trying to look for a way around this using datetutil and pytz, but haven’t had any luck.

Suggestions or workaround would be appreciated.

string = "Jun 20, 4:00PM EDT" 

I’d like to convert that into UTC time, accounting for daylight savings when appropriate.

UPDATE: Found some references that may help more experienced users answer the Q.

Essentially, I would imagine part of the solution doing the reverse of this.

FINAL UPDATE (IMPORTANT)

Taken from the dateutil docs examples.

Some simple examples based on the date command, using the TZOFFSET dictionary to provide the BRST timezone offset.

parse(“Thu Sep 25 10:36:28 BRST 2003”, tzinfos=TZOFFSETS)
datetime.datetime(2003, 9, 25, 10, 36, 28,
tzinfo=tzoffset(‘BRST’, -10800))

parse(“2003 10:36:28 BRST 25 Sep Thu”, tzinfos=TZOFFSETS)
datetime.datetime(2003, 9, 25, 10, 36, 28,
tzinfo=tzoffset(‘BRST’, -10800))

Combine this with a library such as found here. and you will have a solution to this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:40:07+00:00Added an answer on June 6, 2026 at 3:40 pm

    Using Nas Banov’s excellent dictionary mapping timezone abbreviations to UTC offset:

    import dateutil
    import pytz
    
    # timezone dictionary built here: https://stackoverflow.com/a/4766400/366335
    # tzd = {...}
    
    string = 'Jun 20, 4:00PM EDT'
    date = dateutil.parser.parse(string, tzinfos=tzd).astimezone(pytz.utc)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string 2012-06-04 and am having a hard time converting it to:
Im having a hard time converting cdr files to jpgs for previews using c#.net.
I'm having a hard time converting a NodeList to an array in IE 8.
I am having hard time converting a BasicHttpBinding to custom binding. Specifically I need
Having hard time figuring out how to take the returned orm object and converting
I'm having hard time writing a makefile rule that outputs a multiline variable in
Hehe I'm having hard time on choosing the question title. But let me explain
I'm having hard time trying to figure out how to auto-save user data in
I am having hard time in understanding Wait() , Pulse() , PulseAll() . Will
I am having hard time getting hasErrors to work with indexed properties. For example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.