Keith Griffin4,833 Points
How do you enter the value of the datetime object
I've tried entering the date several different ways and always get a value error.
import datetime def to_string(datetime_object): date = datetime.datetime.strptime('datetime_object' , '%d %B %Y') return date to_string("24/09/2012")
Jennifer NordellTreehouse Staff
Hi there, Keith Griffin ! I can see that you've made some effort with this, but aren't quite there yet. The
return a string. The parameter
datetime_object (as you've named it) is a datetime object already. You can call the
strftime directly on that object and pass in the string
'%d %B %Y'. You do not need to call the function yourself. Treehouse tests will call the function and pass a datetime object.
Hope this helps!