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.
Adam Vasik11,694 Points
Turning naive into aware datetime..
I tried hill_valey = naive.astimezone(pacific), it prints datetime it should print but here it throws a bummer.. I also tried hill_valey = naive.replace(tzinfo=pacific), what this does it doesn't modify naive when printed, prints "datetime - timezone'' #OUTPUT: 2015-10-21 04:29:00-08:00
import datetime naive = datetime.datetime(2015, 10, 21, 4, 29) pacific = datetime.timezone(datetime.timedelta(hours=-8)) hill_valey = naive.astimezone(pacific)
Steven Parker210,082 Points
In addtion to the spelling of "hill_valey" instead of "hill_valley", the instructions ask for "
naive with its
replaced...", and the different font used for the word "
replace" hints at a different operation than the one normally used for adjusting the value as you might do with a previously localized datetime:
hill_valey = naive.astimezone(pacific) # original hill_valley = naive.replace(tzinfo=pacific) # corrected