'How do I get the current time, adjusted for daylight savings?

there are lots of questions about getting the current time, but they're not working for me

A common answer is to do the following: datetime.datetime.now(pytz.timezone('EST'))

This solution does not account for daylight savings. It shows now as 11pm when it should be 12pm.

How do I get the current time in python AND account for daylight savings?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source