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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:24:34+00:00 2026-06-11T17:24:34+00:00

Today is my first day at Python and have been going through problems. One

  • 0

Today is my first day at Python and have been going through problems. One that I was working on was, “Write a short program which extracts the current date and time from the operating system and prints it on screen in the following format: day, month, year, current time in GMT.
Demonstrate that it works.”

I was going to use pytz, so used easy_install pytz
This installed it in my site-packages (pytz-2012d-py2.7.egg)

Is this the correct directory for me to be able to import the module?

In my python shell i use from pytz import timezone I get,
"ImportError: No module named pytz"

Any ideas? Thanks in advance

  • 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-11T17:24:35+00:00Added an answer on June 11, 2026 at 5:24 pm

    time module can also help here..
    UTC is Coordinated Universal Time (formerly known as Greenwich Mean Time, or GMT)

    In [18]: import time
    
    In [19]: time.gmtime()
    Out[19]: time.struct_time(tm_year=2012, tm_mon=9, tm_mday=22, tm_hour=3, tm_min=37, tm_sec=15, tm_wday=5, tm_yday=266, tm_isdst=0)
    
    In [20]: x = time.gmtime()
    
    In [21]: x.tm_year
    Out[21]: 2012
    
    In [22]: x.tm_mon
    Out[22]: 9
    
    In [23]: x.tm_mday
    Out[23]: 22
    
    In [24]: x.tm_hour
    Out[24]: 3
    

    Also can you Check the logs while you installed pytz with the below ones…

    C:\>easy_install pytz
    Searching for pytz
    Reading http://pypi.python.org/simple/pytz/
    Reading http://pytz.sourceforge.net
    Reading http://sourceforge.net/project/showfiles.php?group_id=79122
    Reading http://www.stuartbishop.net/Software/pytz
    Reading http://sourceforge.net/projects/pytz/
    Best match: pytz 2012d
    Downloading http://pypi.python.org/packages/2.7/p/pytz/pytz-2012d-py2.7.egg#md5=
    e6f9219ae6eff242f13c6700413df69e
    Processing pytz-2012d-py2.7.egg
    Moving pytz-2012d-py2.7.egg to c:\python27\lib\site-packages
    Adding pytz 2012d to easy-install.pth file
    
    Installed c:\python27\lib\site-packages\pytz-2012d-py2.7.egg
    Processing dependencies for pytz
    Finished processing dependencies for pytz
    
    C:\>python
    Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
    32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pytz
    >>> from datetime import datetime, timedelta
    >>> utc = pytz.utc
    >>> utc.zone
    'UTC'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First day at programming in Node today. I've been getting along nicely all day
I have been using pil for the first time today. And I wanted to
I must confess that today is my first day using either Sweave or LaTeX.
Today's my first day with Flex and FlashDevelop. In my ActionScript file, I have
Today is my first day working with SQL so please bear with me for
Today is my first day using the Google Maps API. Now I have a
Today is my first day learning java :) I'm having problems running a very
Today is my first day using ASP.NET MVC, and I'm finding it very intriguing.
Please excuse me, today is my first day trying to setup a CI environment
Greetings. I am trying to learn Java and Swing (today is my first day).

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.