Well, i'm not fluent nor perfect in grammar either,
but here is how I would have wrote it:
I would write:
"It was 11am when I wrote 'ohayou'."
The fun part here is how の can be used to nominalize.
So 「おはよう」と書いたの would translate to "when I wrote 'ohayou'"
And even though in English, the coupler is past tense ('was'), in Japanese it stays present tense (「です」).
The best example I have for this is the Japanese comedy show, Gaki no tsukai arahen de, the Absolutely Tasty series.
( I think th