I have noticed very little correlation between time of day and prime hacking hours. For me, it's whenever I can ensure a 4 hour (or more) chunk of time without meetings/interruptions, which tends to be either early in the day or late at night.
Side note: do write code not like this, please.