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

Manuel Avila
Manuel Avila
2,240 Points

Create a variable named moscow that holds a datetime.timezone object at +4 hours.

import datetime moscow = datetime.timezone(datetime.timedelta(hours=5))

not sure why it wont pass

timezones.py
import datetime 
moscow = datetime.timezone(datetime.timedelta(hours=5))

3 Answers

Greg Kaleka
Greg Kaleka
39,012 Points

Hey Manuel,

You're using 5 when the challenge states the offset should be 4.

Cheers :beers:

-Greg

Mahdi Jafari
Mahdi Jafari
16,299 Points

This is how I did it

import datetime 
moscow = datetime.timezone(datetime.timedelta(hours=4))
Manuel Avila
Manuel Avila
2,240 Points

Thank you, simple typo was ruining my day

Greg Kaleka
Greg Kaleka
39,012 Points

Hah yep, they tend to do that!