فترة الغروب

What is the ruling on someone who eats or drinks thinking that the night is still going on, or eats or drinks thinking that the day is over?