Date formatting

Date formatting

Hi,

       I have a question on how the date is counted as in is a day? like yesterday 00 00- the today 00 00 or is it yesterday 01 00 - yesterday 23 59?

      And what is the way to format a specific date and time if i have the date and would like to set a custom time?