Writer's block, bad day, in a funk...call it what you will, but it is bound to strike sooner or later.
I struggle to write on the days I am not in the mood. Sometimes I would rather be walking the dogs, cleaning the house, anything other than staring at my computer screen.
Then there are the times when I stay up until all hours of the night/morning, running with an idea that won't allow me to sleep. My best work is done during these times. The ideas and words show up on the screen as if someone else were thinking and typing them. In the morning, I might be surprised with what I have written. Pleasantly surprised.
I read an interview with a successful author who touched on this very idea. He claimed that, if you want to pay the bills, you ignore the mood and get on with the business.
Writing is often called a craft. I think the craft in writing is the ability to produce solid work while daydreaming about flying a kite, watching Oprah, eating ice cream...