Skip to content
Snippets Groups Projects
Commit 1214fda6 authored by Vit Ptosek's avatar Vit Ptosek
Browse files

rounding down to nearest offset

parent 57f1b636
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ namespace FcdAggregationLauncher.Extensions {
}
public static DateTime ToStartingTimestep(this DateTime dateTime, ushort minuteOffset) {
return dateTime.AddMinutes(minuteOffset * -1).AddSeconds(dateTime.Second * -1);
return dateTime.AddTicks(-(dateTime.Ticks % TimeSpan.FromMinutes(minuteOffset * -1).Ticks));
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment