Skimmed the replies but set an end goal how ever long or close it may be until you finish the job. It has always helped me pull through those shitty days looking forward to leaving the job and going onto better things.
I'll work for a few years save money and then travel for as long as possible. Live cheaply/comfortably get a hobby to help keep you occupied, girlfriends work to.
Also take your lunch break away from your desk and try to have it later in the afternoon splits up the day and makes the afternoon go by fast