Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Dates and Times in Python (2014) Dates and Times now() and .replace()

Challenge Task 2 of 4 Create a variable named now that holds the results of datetime.datetime.now().

Challenge Task 2 of 4

Create a variable named now that holds the results of datetime.datetime.now().

dt.py
import datetime
treehouse_start= datetime.datetime.now()

It passed do not bother, i have seen where i was going wrong:

import datetime now=datetime.datetime.now()

3 Answers

Your variable's name is supposed to be now, so...your code should be something like this:

import datetime
now = datetime.datetime.now()
Anish Walawalkar
Anish Walawalkar
8,534 Points

well its stated in the question that you have to name the variable "now" so this should do it from you:

import datetime
now = datetime.datetime.now()

Hope that helps

I realized my mistake and worked it out some seconds after posting on this forum. Thanks for the help.