Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Dates and Times in Python Dates and Times strftime & strptime

Please help.I don't understand why my code is not working!!

it runs on the IDE but refuses on the challenge

timestrings.py
## Examples
# to_string(datetime_object) => "24 September 2012"
# from_string("09/24/12 18:30", "%m/%d/%y %H:%M") => datetime
import datetime

def to_string(datetime):
    return datetime.strftime("%d%B%Y")

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,631 Points

Hi Angela,

Your code does look correct (except maybe needing spacing between the different parts of the date). Unfortunately, there seems to be some technical glitches in the challenges right now that is preventing the code checker from properly checking and passing your code, or providing a proper error message. The wonderful Support Team is aware and are looking into the issue. If you like, you can continue on with the course by navigating using the little bubbles on top of the video screen to jump to the next step after the challenge.

Once the issue has been resolved, you can come back to the challenge and complete it.

Sorry for the problems. :(

But nice work! :) :dizzy:

Thank you very much Jason for the update