## 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. # I've attempted writing this function 2 different ways and both ways fail in the challenge task, but pass in PyCharm

Both of these functions work in PyCharm but fail in the challenge on Treehouse

```from datetime import datetime

def time_tango(date1, time1):
dt = datetime.strptime(f'{date1} {time1}', '%Y-%m-%d %H:%M:%S')
return dt
```
```from datetime import datetime, date, time

def time_tango(date1, time1):
year = date1.year
month = date1.month
day = date1.day
hour = time1.hour
minute = time1.minute
seconds = time1.second
dt = datetime(year, month, day, hour, minute, seconds)
return dt
```
combo.py
```from datetime import datetime

def time_tango(date1, time1):
dt = datetime.strptime(f'{date1} {time1}', '%Y-%m-%d %H:%M:%S')
return dt
``` MOD

Hey David Jones, The short answer is you are be correct! The issue is with the challenge checker.

For your case, import just the top level module `datetime` then use `datetime.datetime`

Also fixed to include `microsecond`

This fails:

```#import datetime
from datetime import datetime

def time_tango(date1, time1):
year = date1.year
month = date1.month
day = date1.day
hour = time1.hour
minute = time1.minute
seconds = time1.second
# calling class directly
dt = datetime(
year, month, day, hour,
minute, seconds, microsecs)
return dt
```

This passes 👍

```import datetime
# from datetime import datetime, date, time

def time_tango(date1, time1):
year = date1.year
month = date1.month
day = date1.day
hour = time1.hour
minute = time1.minute
seconds = time1.second