I am presently coding from home 9 to 5:30. I have learned to manage those who are my bosses and not let their bad decisions affect me.
You have to remember most of these people don't know how to code and are mostly either try to cover their a$$'e$ or trying to get promoted; their mostly ignorant regardless of what they say. Don't educate them, they'll only think they can tell you how to do your job.
The whole thing that has been life changing is to not agree to any craziness like working 24x7 trying to code to unrealistic deadlines. I also don't volunteer or try and please anyone, except maybe someone else on the dev team, at the end of the day, it's just a job. It's not worth being upset and having a heart attack or anything like that.
Remember IT is like being a whore in a whore house, the more you put out the more they'll want you to put out and at the end of the day they'll always dangle the apple in front of you for one thing or another.