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

  • SEARCH
  • Home
  • 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 8069615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:06:31+00:00 2026-06-05T13:06:31+00:00

I want convert GMT time to EST time and get a timestamp. I tried

  • 0

I want convert GMT time to EST time and get a timestamp. I tried the following but don’t know how to set time zone.

time = "Tue, 12 Jun 2012 14:03:10 GMT"
timestamp2 = time.mktime(time.strptime(time, '%a, %d %b %Y %H:%M:%S GMT'))
  • 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-05T13:06:34+00:00Added an answer on June 5, 2026 at 1:06 pm

    Time zones aren’t built into standard Python – you need to use another library. pytz is a good choice.

    >>> gmt = pytz.timezone('GMT')
    >>> eastern = pytz.timezone('US/Eastern')
    >>> time = "Tue, 12 Jun 2012 14:03:10 GMT"
    >>> date = datetime.datetime.strptime(time, '%a, %d %b %Y %H:%M:%S GMT')
    >>> date
    datetime.datetime(2012, 6, 12, 14, 3, 10)
    >>> dategmt = gmt.localize(date)
    >>> dategmt
    datetime.datetime(2012, 6, 12, 14, 3, 10, tzinfo=<StaticTzInfo 'GMT'>)
    >>> dateeastern = dategmt.astimezone(eastern)
    >>> dateeastern
    datetime.datetime(2012, 6, 12, 10, 3, 10, tzinfo=<DstTzInfo 'US/Eastern' EDT-1 day, 20:00:00 DST>)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to convert GMT +530 to CET (Central European Time) in iPhone sdk?
How to get Locale using Php,I want to get the time zone based on
I have a timestamp I want to convert to a date. I tried this
I want to convert DateTime.Today to GMT time. i.e. If I am in L.A.
In my application, I just want to convert a local time to GMT and
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT
I want to convert a column of numbers to numeric, but there are certain
is there a way to convert from unix timestamp to GMT in mysql while
I want to convert a data string into a timestamp (which would include the
I want to convert my Local date ([NSDate date]) to GMT to create a

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.