Detect when a player stands under the night sky

I tried using advancements to detect this but I can't seem to figure it out. Any help would be greatly appreciated!

Continue to help post