Skip to content

Instantly share code, notes, and snippets.

@alastairtree
Created June 29, 2017 13:30
Show Gist options
  • Save alastairtree/10433c97da0f33d2229439dbcf2eef8b to your computer and use it in GitHub Desktop.
Save alastairtree/10433c97da0f33d2229439dbcf2eef8b to your computer and use it in GitHub Desktop.
using System;
namespace Util
{
public interface IClock
{
DateTime NowUtc { get; }
}
public class Clock : IClock
{
public static readonly Clock Default;
static Clock()
{
Default = new Clock();
}
public virtual DateTime NowUtc => DateTime.UtcNow;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment