Internally both Google and Excel store timestamps as a day + fraction.
Jan 3 2018 + 3 = Jan 6 2018.
You can see this if you display a date as a number.
Timestamps are stored as a decimal fraction of a day. 6 a.m. is .25 etc.
Formatting changes the way a number is interpreted. In Sheets there are a raft of general building blocks for constructing various special formats. e.g. you can do elapsed time in just minutes, in hours and minutes, in days, hours and minutes depending on how you want the format to display. This can sometimes bite you. I wanted to subtract off lunch breaks in minutes from the result of H:MM start time and H:MM end time. The first time I didn't say 'minutes' and it was interpreted as days so I got this large negative number.