Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (20 sloc) 0.769 kB
using System;
namespace Quartz
{
/// <summary>
/// A time source for Quartz.NET that returns the current time.
/// Original idea by Ayende Rahien:
/// http://ayende.com/Blog/archive/2008/07/07/Dealing-with-time-in-tests.aspx
/// </summary>
public static class SystemTime
{
/// <summary>
/// Return current UTC time via <see cref="Func&lt;T&gt;" />. Allows easier unit testing.
/// </summary>
public static Func<DateTimeOffset> UtcNow = () => DateTimeOffset.UtcNow;
/// <summary>
/// Return current time in current time zone via <see cref="Func&lt;T&gt;" />. Allows easier unit testing.
/// </summary>
public static Func<DateTimeOffset> Now = () => DateTimeOffset.Now;
}
}
Jump to Line
Something went wrong with that request. Please try again.