Fix for date grid over Day light saving time

Correction of bug #1318.
Grid times are always truncated to get the time for day grid at 00:00
instead of 23:00 or 01:00 when adding 24h.
A margin is added to the time value before it is truncated so that
23:00->00:00 truncated to 00:00
00:00->01:00 truncated to 00:00
01:00->02:00 truncated to 00:00