It seems that by default in MS Project, the work time is turned on, and the duration is calculated in hours. With that configuration, a task will never start at the beginning of the day (00:00). Instead, it will fit the 08:00-17:00 hours. Though you can see the same dates in the grid, the hours are different.
If you remove the calendar, the task will still have the duration of 8 hours:
If that is what you want to see in Gantt, you can easily configure it without applying custom solutions. You will need to set the duration_unit to ‘hour’ and enable the work_time parameter:
The dates in the grid will look the same way as in MS Project.
To show the duration in days and even in fractional values, you can use the formatters:
Here is the snippet that demonstrates how it works:
I know that the only other way to display tasks in MS Project from 00:00 to 23:59 is to set 24 hours per day:
However, in that case, the end date is different from the start date.