In theory, a stay from 2350hrs to 0010hrs would count as two days out of the 90, but in practice it depends on whether the immigration officer has changed the date on their stamp
I have had two officers stamp me with the incorrect date but as I wasn't planning to spend anywhere close to 90 days it didn't matter. However, the correct date may have been recorded on that country's computer systems which may be revealed on future visits to that particular country.