forked from ServiceStack/ServiceStack.Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemTime.cs
More file actions
40 lines (36 loc) · 935 Bytes
/
SystemTime.cs
File metadata and controls
40 lines (36 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// https://github.com/ServiceStack/ServiceStack.Text
// ServiceStack.Text: .NET C# POCO JSON, JSV and CSV Text Serializers.
//
// Authors:
// Demis Bellot (demis.bellot@gmail.com)
// Damian Hickey (dhickey@gmail.com)
//
// Copyright 2012 ServiceStack, Inc. All Rights Reserved.
//
// Licensed under the same terms of ServiceStack.
//
using System;
namespace ServiceStack.Text
{
public static class SystemTime
{
public static Func<DateTime> UtcDateTimeResolver;
public static DateTime Now
{
get
{
var temp = UtcDateTimeResolver;
return temp == null ? DateTime.Now : temp().ToLocalTime();
}
}
public static DateTime UtcNow
{
get
{
var temp = UtcDateTimeResolver;
return temp == null ? DateTime.UtcNow : temp();
}
}
}
}