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 trialEinars Vilnis
8,050 Pointscombo.py callenge
hallo guys! I simply don't get this at all . i guess that my function is wrong but I don't even now where and why :(
import datetime
def time_tango(day, mytime):
day = datetime.datetime.strftime('%d/%m/%y')
mytime = datetime.datetime.strftime('%H:%M')
daymytime1 = day + mytime
daymytime = datetime.datetime.strptime(daymytime, '%d/%m/%y %H:%M')
return daymytime
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsHey there, is it giving an error code or compiler error?
3 Answers
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsHey there Einars,
I can see that you were able to look into this and found the function on the new thread, was that able to clear up any questions you had?
If so, I was able to get the challenge to pass by passing the function built into it
import datetime
def time_tango(date, time):
return datetime.datetime.combine(date, time)
Thanks, let me know if this doesn't help.
Einars Vilnis
8,050 PointsYes it did help ! thanks for your time.
Einars Vilnis
8,050 Pointsit shows that it doesn't return the right datetime, and by the way ' time = datetime.time(10, 10, 10, 10, None)' in my final code
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsOkay I'm on my phone right now I'd have to give this a look in an hour or so once I get home.
Einars Vilnis
8,050 Pointsthank you.
Einars Vilnis
8,050 PointsEinars Vilnis
8,050 Pointsimport datetime
def time_tango(date, time): date = datetime.date(2015, 10, 15) date = date.strftime('%d.%m.%Y') time = datetime.time(10, 10, 10, 10, None) time = time.strftime('%H:%M') datetime1 = '{} {}'.format(date, time) new_date = datetime.datetime.strptime(datetime1, '%d.%m.%Y %H:%M') return new_date
my new try and still isnt working