mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-23 19:15:07 -05:00
Fix typo and deprecate it
This commit is contained in:
@@ -6,15 +6,17 @@ namespace UniJSON
|
||||
public static class DateTimeOffsetExtensions
|
||||
{
|
||||
public const long TicksPerSecond = 10000000;
|
||||
public readonly static DateTimeOffset EpocTime = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
|
||||
public readonly static DateTimeOffset EpochTime = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
|
||||
[Obsolete("Use EpochTime")]
|
||||
public readonly static DateTimeOffset EpocTime = EpochTime;
|
||||
#if !NET_4_6 && !NET_STANDARD_2_0
|
||||
public static long ToUnixTimeSeconds(this DateTimeOffset now)
|
||||
{
|
||||
if (now < EpocTime)
|
||||
if (now < EpochTime)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
return (now - EpocTime).Ticks / TicksPerSecond;
|
||||
return (now - EpochTime).Ticks / TicksPerSecond;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user