22 lines
472 B
C#
22 lines
472 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Tadah
|
|
{
|
|
public class Unix
|
|
{
|
|
public static int Now()
|
|
{
|
|
return (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds;
|
|
}
|
|
|
|
public static int From(DateTime time)
|
|
{
|
|
return (int)(time - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds;
|
|
}
|
|
}
|
|
}
|