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.

Python Dates and Times in Python Where on Earth do Timezones Make Sense? Timezone Strings

Sam Cerwinske
Sam Cerwinske
Courses Plus Student 2,876 Points

code challenge: timezone strings

I'm not really sure where to go from here as i feel this wasn't thoroughly discussed in the lesson

import datetime

import pytz

starter = pytz.utc.localize(datetime.datetime(2015, 10, 21, 23, 29))
Sam Cerwinske
Sam Cerwinske
Courses Plus Student 2,876 Points

never mind, i was overthinking the question on little to no sleep.

def to_timezone(zstr): zone = pytz.timezone(zstr) return starter.astimezone(zone)

AJ Tran
AJ Tran
Treehouse Teacher

Glad you figured it out! Sometimes taking a break is good so your "unconscious mind" can think about it. I'm hoping you can rest well! Good rest is key to good learning ;)