Skip to content

Commit b757245

Browse files
authored
Add polyfill for DateTimeOffset.UnixEpoch (#33)
1 parent 91d132c commit b757245

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// The following comment is required to instruct analyzers to skip this file
2+
// <auto-generated/>
3+
4+
#if (NETCOREAPP && !NETCOREAPP2_1_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER)
5+
#nullable enable
6+
// ReSharper disable RedundantUsingDirective
7+
// ReSharper disable CheckNamespace
8+
// ReSharper disable InconsistentNaming
9+
// ReSharper disable PartialTypeWithSinglePart
10+
11+
using System;
12+
13+
internal static partial class PolyfillExtensions
14+
{
15+
extension(DateTimeOffset)
16+
{
17+
// https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.unixepoch?view=net-9.0
18+
public static DateTimeOffset UnixEpoch => new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
19+
}
20+
}
21+
#endif

0 commit comments

Comments
 (0)