When I first started running a fifth-edition Dungeons & Dragons campaign, I took for granted that darkvision (and its predecessors and analogues, such as “infravision” in Advanced Dungeons & Dragons, “low-light vision” in Shadowrun and “night vision” in GURPS) improved a character’s or creature’s ability to see in both dim light and darkness. Then, while writing the first article for this blog, I inadvertently led myself astray by relying on the incomplete description of darkvision on pages 183–85 of the 5E Players’ Handbook, which seems to imply that it improves a character’s or creature’s ability to see only in total darkness. As both the PH chapter 2 race descriptions and the 5E Monster Manual introduction make clear, darkvision lets a character or creature see in dim light as if it were bright light (i.e., no penalty to Perception) and in darkness as if it were dim light (i.e., disadvantage on visual Perception checks, but not blinded). Thanks to Hemlock on the EN World forum for setting me straight.
Anytime a creature has darkvision, the natural implication is that it’s predominantly, if not exclusively, nocturnal or subterranean. In the case of monsters living aboveground, you can assume that they’ll prefer to attack at night, although they may sometimes move about during the day. However, unless there’s a reason to think of them as exclusively nocturnal (or if it serves the campaign to have the player characters stumble upon them while they’re sleeping), if a group of PCs encounters them, they’ll be awake and alert.
The Lost Mine of Phandelver begins with a goblin ambush: Two horses lie dead on the road, and while the PCs investigate, four goblins attack them from out of the woods. In all likelihood, this discovery takes place during the day. Goblins have darkvision. There’s not necessarily any contradiction here. While goblins may be more active at night and may prefer to fight at night, the travelers they enjoy waylaying move during the day. Therefore, if they want to carry out a successful ambush, it’s got to happen during the day.
In other words, darkvision doesn’t rule out the possibility of daylight activity. It simply tells us when and where a monster will fight, given the choice. If there’s some other situational factor that justifies a daylight encounter, of course it can happen in daylight. Otherwise, every aboveground D&D campaign would be a succession of discoveries of groups of snoozing monsters, which the PCs could either easily circumvent or slaughter in their sleep.