The yardarms on a sailing ship are the horizontal timbers or spars mounted on the masts, from which the square sails are hung. (The word yard here is from an old Germanic word for a pointed stick, the source also of our unit of measurement.) At certain times of year it will seem from the deck that the sun has risen far enough up the sky that it is above the topmost yardarm. In summer in the north Atlantic, where the phrase seems to have originated, this would have been at about 11am. This was by custom and rule the time of the first rum issue of the day to officers and men (the officers had their tots neat, the men’s diluted). It seems that officers in sailing ships adopted a custom, even when on shore, of waiting until this time before taking their first alcoholic drink of the day.
Can we have a drink? Yes, the sun is over the yardarm!