If you're looking for an official ruling, you need look no further than the Sage Advice Compendium.

Bold emphasis added to clarify the answer to your question about Cloud of Daggers.

Does moonbeam deal damage when you cast it? What about when its effect moves onto a creature?

The answer to both questions is no. Here’s some elaboration on that answer.

Some spells and other game features create an area of effect that does something when a creature enters that area for the first time on a turn or when a creature starts its turn in that area. On the turn when you cast such a spell, you’re primarily setting up hurt for your foes on later turns. Moonbeam, for example, creates a beam of light that can damage a creature who enters the beam or who starts its turn in the beam.

Here are some spells with the same timing as moonbeam for their areas of effect:

blade barrier
cloudkill
cloud of daggers
Evard’s black tentacles
forbiddance
moonbeam
sleet storm
spirit guardians

Reading the description of any of those spells, you might wonder whether a creature is considered to be entering the spell’s area of effect if the area is created on the creature’s space. And if the area of effect can be moved—as the beam of moonbeam can—does moving it into a creature’s space count as the creature entering the area? Our design intent for such spells is this: a creature enters the area of effect when the creature passes into it. Creating the area of effect on the creature or moving it onto the creature doesn’t count. If the creature is still in the area at the start of its turn, it is subjected to the area’s effect.

Entering such an area of effect needn’t be voluntary, unless a spell says otherwise. You can, therefore, hurl a creature into the area with a spell like thunderwave. We consider that clever play, not an imbalance, so hurl away! Keep in mind, however, that a creature is subjected to such an area of effect only the first time it enters the area on a turn. You can’t move a creature in and out of it to damage it over and over again on the same turn.

In summary, a spell like moonbeam affects a creature when the creature passes into the spell’s area of effect and when the creature starts its turn there. You’re essentially creating a hazard on the battlefield.