I know when I am coding at my best. Usually it is 3-4pm in the afternoon (know what I want to get accomplished before I leave the office) or 9-10pm at night (know what I want to get accomplished before I go to bed). What is your best coding hours (relative to your timezone) and why?
My best hours at work are between 8am and 10:30am. This is usually because I arrive earlier than my workmates who are in my immediate vicinity and as a result I have less interruptions.
Second to that is 4-5pm for the same reason as the OP(know what I need to get complete before I leave the office).
Usually my best hours are spent in the mornings just after I wake up. I'll sit down, check on a bug and start hammering away at home before heading to the office several hours later. The main benefit for me is I can approach problems with a clear mind that I likely don't have the rest of the day.
4am. I don't get up that early too often, but when I do it's perfect. It's late enough that I can be up for the day, but early enough that I can get into a good focused work zone, and stay there for a couple hours.
It's usually not a matter of when, but what I'm coding. I can be energetic but if I'm coding some boring, trivial task, I probably can't get myself to focus right away