Skip to content

Commit

Permalink
converted ITimeProvider to use DateTimeOffset
Browse files Browse the repository at this point in the history
+semver: minor
  • Loading branch information
Malachi Griffie committed May 25, 2017
1 parent 186761d commit 2ff7132
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/nexus.core/logging/SystemLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private void CreateLogEntry( LogLevel severity, Object[] objects, String message
}

// get the time immediately in case serializing objects takes time
var time = m_timeProvider.UtcNow;
var time = m_timeProvider.UtcNow.UtcDateTime;

var data = new List<Object>();
if(objects != null)
Expand Down
6 changes: 2 additions & 4 deletions src/nexus.core/time/DefaultTimeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

namespace nexus.core.time
{
/// <summary>
/// Use <see cref="DateTime.UtcNow" />
/// </summary>
/// <inheritdoc />
public class DefaultTimeProvider : ITimeProvider
{
/// <inheritdoc />
public DateTime UtcNow => DateTime.UtcNow;
public DateTimeOffset UtcNow => DateTimeOffset.UtcNow;
}
}
10 changes: 1 addition & 9 deletions src/nexus.core/time/ITimeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ namespace nexus.core.time
/// </summary>
public interface ITimeProvider
{
/*
* TODO: Implement, or change UtcNow to DateTimeOffset
/// <summary>
/// The current time in the local timezone
/// </summary>
DateTimeOffset Now { get; }
*/

/// <summary>
/// The current time in UTC
/// </summary>
DateTime UtcNow { get; }
DateTimeOffset UtcNow { get; }
}
}

0 comments on commit 2ff7132

Please sign in to comment.