Nobody knows, they just do.
Somebody knows but it's a mysterious process nonetheless. I picked a few small dandelions and brought them into an office, lit by fluorescent lights. This office has a few small windows far away from where the flowers were so they couldn't be detecting the sunlight.
About 6 pm the dandelions closed up for the night. The next morning they opened up again.
During the day we put a cup over them to keep out the light and they stayed open. I took the cup off after 6 pm and they closed up about an hour later.
So...........
what makes dandelions close at night?
I've seen mention of temperature, sunlight, and rain causing dandelions to close. None of these apply to the artificially lit, temperature controlled cube world I had them in.
I think it's some sort of chemical clock.