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 9028813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:05:22+00:00 2026-06-16T07:05:22+00:00

I have a pandas Series with values of type datetime64[ns] . The dates are

  • 0

I have a pandas Series with values of type datetime64[ns]. The dates are in EST timezone, and I would like to convert them to UTC timezone.

E.g.,

 s=pd.Series(pd.date_range('2012-1-1 1:30',periods=3,freq='min'))

How to convert s to UTC?

(Note that I don’t actually use date_range() so using its tz parameter is not an option.)

  • 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-16T07:05:24+00:00Added an answer on June 16, 2026 at 7:05 am

    Update: In recent pandas, you can use the dt accessor to broadcast this:

    In [11]: s.dt.tz_localize('UTC')
    Out[11]:
    0   2012-01-01 01:30:00+00:00
    1   2012-01-01 01:31:00+00:00
    2   2012-01-01 01:32:00+00:00
    dtype: datetime64[ns, UTC]
    

    Here’s one way (depending if tz is already set it might be a tz_convert rather than tz_localize):

    In [21]: from pandas.lib import Timestamp
    
    In [22]: s.apply(lambda x: x.tz_localize('UTC')) 
    Out[22]: 
    0    2012-01-01 06:30:00+00:00
    1    2012-01-01 06:31:00+00:00
    2    2012-01-01 06:32:00+00:00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some values in a Python Pandas Series (type: pandas.core.series.Series ) In [1]:
I have several Pandas Series objects that look like this: r = pd.Series({'a': [1,2,3,4]})
I have a column in a pandas DataFrame that I would like to split
I have created a Pandas DataFrame df = DataFrame(index=['A','B','C'], columns=['x','y']) Now, I would like
I have pandas DataFrame. I would like to get single value from a column
I have an irregularly indexed time series of data with seconds resolution like: import
I'm trying to merge a series of dataframes in pandas. I have a list
I have a pandas.DatetimeIndex , e.g.: pd.date_range('2012-1-1 02:03:04.000',periods=3,freq='1ms') >>> [2012-01-01 02:03:04, ..., 2012-01-01 02:03:04.002000]
When I have a pandas timestamps like so: list(uni_index) Out[95]: [<Timestamp: 2011-04-16 00:00:01>, <Timestamp:
I have two largish (snippets provided) pandas DateFrame s with unequal dates as indexes

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.