Files
using.cash/Logic/ExtensionMethods/DateTime.cs
T

19 lines
459 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Swarmops.Logic.ExtensionMethods
{
public static partial class DummyWrapper
{
public static Int32 ToUnix (this DateTime source)
{
// Assumes DateTime is already UTC
return (Int32)(source.Subtract(new DateTime(1970, 1, 1, 0, 0, 0,DateTimeKind.Utc))).TotalSeconds;
}
}
}