Sun operates on your 3DS time, so normal time. Moon moves that ahead 12 hours, thus giving you night.
What's funny about this is that I'm getting Sun and my wife is getting Moon, our only real time to play will be after we put our toddler to bed around 8-ish, so I'll be the one playing during the night with Sun while she'll be playing during the day with Moon.