Skip to content

Commit

Permalink
Merge pull request #1762 from libgit2/improve-test-helper
Browse files Browse the repository at this point in the history
Improve TruncateMilliseconds test helper
  • Loading branch information
bording committed Jan 31, 2020
2 parents 5ee2490 + ffeb486 commit 7e40e96
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions LibGit2Sharp.Tests/TestHelpers/DateTimeOffsetExtensions.cs
Expand Up @@ -4,11 +4,6 @@ namespace LibGit2Sharp.Tests.TestHelpers
{
public static class DateTimeOffsetExtensions
{
public static DateTimeOffset TruncateMilliseconds(this DateTimeOffset dto)
{
// From http://stackoverflow.com/a/1005222/335418

return dto.AddTicks( - (dto.Ticks % TimeSpan.TicksPerSecond));
}
public static DateTimeOffset TruncateMilliseconds(this DateTimeOffset dto) => new DateTimeOffset(dto.Year, dto.Month, dto.Day, dto.Hour, dto.Minute, dto.Second, dto.Offset);
}
}

0 comments on commit 7e40e96

Please sign in to comment.