* Update deps, fix test warnings. * Support ns2.0 * Fix typo * Remove ns1.1 support * Net.Http and Net.Websockets.Client are not needed in ns2.0 * Move to net46 per volt * Remove ns1.3 constants
15 lines
479 B
C#
15 lines
479 B
C#
using System;
|
|
|
|
namespace Discord
|
|
{
|
|
//Source: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/DateTimeOffset.cs
|
|
internal static class DateTimeUtils
|
|
{
|
|
public static DateTimeOffset FromTicks(long ticks)
|
|
=> new DateTimeOffset(ticks, TimeSpan.Zero);
|
|
public static DateTimeOffset? FromTicks(long? ticks)
|
|
=> ticks != null ? new DateTimeOffset(ticks.Value, TimeSpan.Zero) : (DateTimeOffset?)null;
|
|
|
|
}
|
|
}
|